Enhancement of interlayer exchange in an ultrathin two-dimensional magnet