l=require("fs").readFileSync("/dev/stdin","utf8").split(/[\s]+/);a={};p=0;r=1;for(i=0,n=+l.shift();i<n;i++){if(p!==0&&([...p].pop()!=l[i][0]||a[l[i]])){r=0;break}a[p=l[i]]=1;}console.log(r?"Yes":"No")