implicit none
integer :: n
character(10),allocatable :: str(:)
integer,allocatable :: ns(:)
integer :: i,j,k
logical :: flg

read *,n
allocate(str(n))
allocate(ns(n))

read *,str(1)
ns(1) = len_trim(str(1))

do i = 2, n
   read *,str(i)
   ns(i) = len_trim(str(i))
   if (str(i-1)(ns(i-1):ns(i-1)) /= str(i)(1:1)) then
      write(*,'(a)') 'No'
      stop
   endif
   do j = 1, i-1
      if (ns(i) /= ns(j)) then
         cycle
      endif
	  if (str(i)(1:ns(i)) .eq. str(j)(1:ns(i))) then
         write(*,'(a)') 'No'
         stop
      endif
   enddo
enddo

write(*,'(a)') 'Yes'
end