A heterochromatin inducing protein differentially recognizes self versus foreign genomes