The device including a portion for forming a photoprint of the alignment mark of the mask on the resist layer provided on the surface of the wafer, a portion for removing at least a portion of the resist layer adjacent to the alignment mark of the wafer, and a portion for detecting the alignment mark of the wafer and the photoprint of the alignment mark of the mask.