The reaction of 3-cyano-2H-thiin derivatives with chloramine salt or diazomalonate gave the corresponding sulfilimines or sulfonium ylides and dihydrothiepin derivatives. These products rearranged by the action of DBU eventually to afford pyridine derivatives or benzofuran and benzothiophene derivatives.