read n
a=(`dd`)
c=${a[0]: -1}
for((;++i<n;))do
	d=${a[i]:0:1}
	if [ $c != $d ];then
		echo No
		exit
	fi
	c=${a[i]: -1}
done
if [ $n -gt `echo ${a[*]}|xargs -n1|sort -u|wc -l` ];then
	echo No
else
	echo Yes
fi
