Copper-catalyzed synthesis of medium- and large-sized nitrogen heterocycles via N-arylation of phosphoramidates and carbamates.