import java.util.*;
public class Main{
	public static void main(String[] args){
    	Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();
      String[] str = new String[n];
      boolean count = true;
      for(int i = 0;i < n;i++){
      	str[i] = sc.next();
      }
      for(int i = 1;i < n;i++){
      	for(int j = 0;j < i;j++){
        	if( str[i].equals(str[j]) ) count = false;
        }
      }
      for(int i = 1;i < n;i++){
      	if(!(str[i-1].substring(str[i-1].length()-1,str[i-1].length()).equals(str[i].substring(0,1)) ))
          count = false;
      }
      if(count)System.out.println("Yes");
      else System.out.println("No");
    }
} import java.util.*; util.* java public class Main{
	public static void main(String[] args){
    	Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();
      String[] str = new String[n];
      boolean count = true;
      for(int i = 0;i < n;i++){
      	str[i] = sc.next();
      }
      for(int i = 1;i < n;i++){
      	for(int j = 0;j < i;j++){
        	if( str[i].equals(str[j]) ) count = false;
        }
      }
      for(int i = 1;i < n;i++){
      	if(!(str[i-1].substring(str[i-1].length()-1,str[i-1].length()).equals(str[i].substring(0,1)) ))
          count = false;
      }
      if(count)System.out.println("Yes");
      else System.out.println("No");
    }
} Main public static void main(String[] args){
    	Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();
      String[] str = new String[n];
      boolean count = true;
      for(int i = 0;i < n;i++){
      	str[i] = sc.next();
      }
      for(int i = 1;i < n;i++){
      	for(int j = 0;j < i;j++){
        	if( str[i].equals(str[j]) ) count = false;
        }
      }
      for(int i = 1;i < n;i++){
      	if(!(str[i-1].substring(str[i-1].length()-1,str[i-1].length()).equals(str[i].substring(0,1)) ))
          count = false;
      }
      if(count)System.out.println("Yes");
      else System.out.println("No");
    } main {
    	Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();
      String[] str = new String[n];
      boolean count = true;
      for(int i = 0;i < n;i++){
      	str[i] = sc.next();
      }
      for(int i = 1;i < n;i++){
      	for(int j = 0;j < i;j++){
        	if( str[i].equals(str[j]) ) count = false;
        }
      }
      for(int i = 1;i < n;i++){
      	if(!(str[i-1].substring(str[i-1].length()-1,str[i-1].length()).equals(str[i].substring(0,1)) ))
          count = false;
      }
      if(count)System.out.println("Yes");
      else System.out.println("No");
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc String[] str = new String[n]; str new String[n] n boolean count = true; count true for(int i = 0;i < n;i++){
      	str[i] = sc.next();
      } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
      	str[i] = sc.next();
      } {
      	str[i] = sc.next();
      } str[i] = sc.next() str[i] str i sc.next() sc.next sc for(int i = 1;i < n;i++){
      	for(int j = 0;j < i;j++){
        	if( str[i].equals(str[j]) ) count = false;
        }
      } int i = 1; int i = 1; i 1 i < n i n i++ i++ i {
      	for(int j = 0;j < i;j++){
        	if( str[i].equals(str[j]) ) count = false;
        }
      } {
      	for(int j = 0;j < i;j++){
        	if( str[i].equals(str[j]) ) count = false;
        }
      } for(int j = 0;j < i;j++){
        	if( str[i].equals(str[j]) ) count = false;
        } int j = 0; int j = 0; j 0 j < i j i j++ j++ j {
        	if( str[i].equals(str[j]) ) count = false;
        } {
        	if( str[i].equals(str[j]) ) count = false;
        } if( str[i].equals(str[j]) ) count = false; str[i].equals(str[j]) str[i].equals str[i] str i str[j] str j count = false count false for(int i = 1;i < n;i++){
      	if(!(str[i-1].substring(str[i-1].length()-1,str[i-1].length()).equals(str[i].substring(0,1)) ))
          count = false;
      } int i = 1; int i = 1; i 1 i < n i n i++ i++ i {
      	if(!(str[i-1].substring(str[i-1].length()-1,str[i-1].length()).equals(str[i].substring(0,1)) ))
          count = false;
      } {
      	if(!(str[i-1].substring(str[i-1].length()-1,str[i-1].length()).equals(str[i].substring(0,1)) ))
          count = false;
      } if(!(str[i-1].substring(str[i-1].length()-1,str[i-1].length()).equals(str[i].substring(0,1)) ))
          count = false; !(str[i-1].substring(str[i-1].length()-1,str[i-1].length()).equals(str[i].substring(0,1)) ) (str[i-1].substring(str[i-1].length()-1,str[i-1].length()).equals(str[i].substring(0,1)) ) str[i-1].substring(str[i-1].length()-1,str[i-1].length()).equals str[i-1].substring(str[i-1].length()-1,str[i-1].length()) str[i-1].substring str[i-1] str i-1 i 1 str[i-1].length()-1 str[i-1].length() str[i-1].length str[i-1] str i-1 i 1 1 str[i-1].length() str[i-1].length str[i-1] str i-1 i 1 str[i].substring(0,1) str[i].substring str[i] str i 0 1 count = false count false if(count)System.out.println("Yes");
      else System.out.println("No"); count System.out.println("Yes") System.out.println System.out System System.out "Yes" System.out.println("No") System.out.println System.out System System.out "No" String[] args args public class Main{
	public static void main(String[] args){
    	Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();
      String[] str = new String[n];
      boolean count = true;
      for(int i = 0;i < n;i++){
      	str[i] = sc.next();
      }
      for(int i = 1;i < n;i++){
      	for(int j = 0;j < i;j++){
        	if( str[i].equals(str[j]) ) count = false;
        }
      }
      for(int i = 1;i < n;i++){
      	if(!(str[i-1].substring(str[i-1].length()-1,str[i-1].length()).equals(str[i].substring(0,1)) ))
          count = false;
      }
      if(count)System.out.println("Yes");
      else System.out.println("No");
    }
} public class Main{
	public static void main(String[] args){
    	Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();
      String[] str = new String[n];
      boolean count = true;
      for(int i = 0;i < n;i++){
      	str[i] = sc.next();
      }
      for(int i = 1;i < n;i++){
      	for(int j = 0;j < i;j++){
        	if( str[i].equals(str[j]) ) count = false;
        }
      }
      for(int i = 1;i < n;i++){
      	if(!(str[i-1].substring(str[i-1].length()-1,str[i-1].length()).equals(str[i].substring(0,1)) ))
          count = false;
      }
      if(count)System.out.println("Yes");
      else System.out.println("No");
    }
} Main
import java.util.*;
public class Main{
	public static void main(String[] args){
    	Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();
      String[] str = new String[n];
      boolean count = true;
      for(int i = 0;i < n;i++){
      	str[i] = sc.next();
      }
      for(int i = 1;i < n;i++){
      	for(int j = 0;j < i;j++){
        	if( str[i].equals(str[j]) ) count = false;
        }
      }
      for(int i = 1;i < n;i++){
      	if(!(str[i-1].substring(str[i-1].length()-1,str[i-1].length()).equals(str[i].substring(0,1)) ))
          count = false;
      }
      if(count)System.out.println("Yes");
      else System.out.println("No");
    }
}
