read N
wards=(`dd`)
for((i=0,j=1;j<N;++i,++j))
do
    if [ ${wards[i]: -1} != ${wards[j]:0:1} ]
    then
        echo 'No'
        exit 0
    fi
done
if [[ $(IFS=$'\n' sort -u <<<"${wards[*]}" | wc -l) -lt $N ]]
then
    echo 'No'
else
    echo 'Yes'
fi
