import java.util.Scanner;

public class Main {
	  
	public static void main(String args[]) {
		    Scanner scanner = new Scanner(System.in);
		    
		    int n = scanner.nextInt();
		    String[] array = new String[n];
		    
		    for(int i = 0; i < n; i++) 
		    {
		    	array[i] = scanner.next();
		    }
		    int matigai = 0;
		    
		    for(int i = 0; i < n - 1; i++) 
		    {
		    	if(array[i].substring(array[i].length() - 1).equals(array[i+1].substring(0,1))) 
		    	{
		    		
		    	}
		    	else 
		    	{
		    		matigai++;
		    	}
		    }
		    for(int i = 0; i < n; i++) 
		    {
		    	for(int j = 0; j < i; j++) 
		    	{
		    		if(array[i].equals(array[j])) 
		    		{
		    			matigai++;
		    		}
		    	}
		    }
		    
		    if(matigai == 0) 
		    {
		    	System.out.println("Yes");
		    }
		    else 
		    {
		    	System.out.println("No");
		    }
		    
		    scanner.close(); }
		  } import java.util.Scanner; Scanner java.util public class Main {
	  
	public static void main(String args[]) {
		    Scanner scanner = new Scanner(System.in);
		    
		    int n = scanner.nextInt();
		    String[] array = new String[n];
		    
		    for(int i = 0; i < n; i++) 
		    {
		    	array[i] = scanner.next();
		    }
		    int matigai = 0;
		    
		    for(int i = 0; i < n - 1; i++) 
		    {
		    	if(array[i].substring(array[i].length() - 1).equals(array[i+1].substring(0,1))) 
		    	{
		    		
		    	}
		    	else 
		    	{
		    		matigai++;
		    	}
		    }
		    for(int i = 0; i < n; i++) 
		    {
		    	for(int j = 0; j < i; j++) 
		    	{
		    		if(array[i].equals(array[j])) 
		    		{
		    			matigai++;
		    		}
		    	}
		    }
		    
		    if(matigai == 0) 
		    {
		    	System.out.println("Yes");
		    }
		    else 
		    {
		    	System.out.println("No");
		    }
		    
		    scanner.close(); }
		  } Main public static void main(String args[]) {
		    Scanner scanner = new Scanner(System.in);
		    
		    int n = scanner.nextInt();
		    String[] array = new String[n];
		    
		    for(int i = 0; i < n; i++) 
		    {
		    	array[i] = scanner.next();
		    }
		    int matigai = 0;
		    
		    for(int i = 0; i < n - 1; i++) 
		    {
		    	if(array[i].substring(array[i].length() - 1).equals(array[i+1].substring(0,1))) 
		    	{
		    		
		    	}
		    	else 
		    	{
		    		matigai++;
		    	}
		    }
		    for(int i = 0; i < n; i++) 
		    {
		    	for(int j = 0; j < i; j++) 
		    	{
		    		if(array[i].equals(array[j])) 
		    		{
		    			matigai++;
		    		}
		    	}
		    }
		    
		    if(matigai == 0) 
		    {
		    	System.out.println("Yes");
		    }
		    else 
		    {
		    	System.out.println("No");
		    }
		    
		    scanner.close(); } main {
		    Scanner scanner = new Scanner(System.in);
		    
		    int n = scanner.nextInt();
		    String[] array = new String[n];
		    
		    for(int i = 0; i < n; i++) 
		    {
		    	array[i] = scanner.next();
		    }
		    int matigai = 0;
		    
		    for(int i = 0; i < n - 1; i++) 
		    {
		    	if(array[i].substring(array[i].length() - 1).equals(array[i+1].substring(0,1))) 
		    	{
		    		
		    	}
		    	else 
		    	{
		    		matigai++;
		    	}
		    }
		    for(int i = 0; i < n; i++) 
		    {
		    	for(int j = 0; j < i; j++) 
		    	{
		    		if(array[i].equals(array[j])) 
		    		{
		    			matigai++;
		    		}
		    	}
		    }
		    
		    if(matigai == 0) 
		    {
		    	System.out.println("Yes");
		    }
		    else 
		    {
		    	System.out.println("No");
		    }
		    
		    scanner.close(); } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int n = scanner.nextInt(); n scanner.nextInt() scanner.nextInt scanner String[] array = new String[n]; array new String[n] n for(int i = 0; i < n; i++) 
		    {
		    	array[i] = scanner.next();
		    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
		    	array[i] = scanner.next();
		    } {
		    	array[i] = scanner.next();
		    } array[i] = scanner.next() array[i] array i scanner.next() scanner.next scanner int matigai = 0; matigai 0 for(int i = 0; i < n - 1; i++) 
		    {
		    	if(array[i].substring(array[i].length() - 1).equals(array[i+1].substring(0,1))) 
		    	{
		    		
		    	}
		    	else 
		    	{
		    		matigai++;
		    	}
		    } int i = 0; int i = 0; i 0 i < n - 1 i n - 1 n 1 i++ i++ i {
		    	if(array[i].substring(array[i].length() - 1).equals(array[i+1].substring(0,1))) 
		    	{
		    		
		    	}
		    	else 
		    	{
		    		matigai++;
		    	}
		    } {
		    	if(array[i].substring(array[i].length() - 1).equals(array[i+1].substring(0,1))) 
		    	{
		    		
		    	}
		    	else 
		    	{
		    		matigai++;
		    	}
		    } if(array[i].substring(array[i].length() - 1).equals(array[i+1].substring(0,1))) 
		    	{
		    		
		    	}
		    	else 
		    	{
		    		matigai++;
		    	} array[i].substring(array[i].length() - 1).equals(array[i+1].substring(0,1)) array[i].substring(array[i].length() - 1).equals array[i].substring(array[i].length() - 1) array[i].substring array[i] array i array[i].length() - 1 array[i].length() array[i].length array[i] array i 1 array[i+1].substring(0,1) array[i+1].substring array[i+1] array i+1 i 1 0 1 {
		    		
		    	} {
		    		matigai++;
		    	} matigai++ matigai for(int i = 0; i < n; i++) 
		    {
		    	for(int j = 0; j < i; j++) 
		    	{
		    		if(array[i].equals(array[j])) 
		    		{
		    			matigai++;
		    		}
		    	}
		    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
		    	for(int j = 0; j < i; j++) 
		    	{
		    		if(array[i].equals(array[j])) 
		    		{
		    			matigai++;
		    		}
		    	}
		    } {
		    	for(int j = 0; j < i; j++) 
		    	{
		    		if(array[i].equals(array[j])) 
		    		{
		    			matigai++;
		    		}
		    	}
		    } for(int j = 0; j < i; j++) 
		    	{
		    		if(array[i].equals(array[j])) 
		    		{
		    			matigai++;
		    		}
		    	} int j = 0; int j = 0; j 0 j < i j i j++ j++ j {
		    		if(array[i].equals(array[j])) 
		    		{
		    			matigai++;
		    		}
		    	} {
		    		if(array[i].equals(array[j])) 
		    		{
		    			matigai++;
		    		}
		    	} if(array[i].equals(array[j])) 
		    		{
		    			matigai++;
		    		} array[i].equals(array[j]) array[i].equals array[i] array i array[j] array j {
		    			matigai++;
		    		} matigai++ matigai if(matigai == 0) 
		    {
		    	System.out.println("Yes");
		    }
		    else 
		    {
		    	System.out.println("No");
		    } matigai == 0 matigai 0 {
		    	System.out.println("Yes");
		    } System.out.println("Yes") System.out.println System.out System System.out "Yes" {
		    	System.out.println("No");
		    } System.out.println("No") System.out.println System.out System System.out "No" scanner.close() scanner.close scanner String args[] args public class Main {
	  
	public static void main(String args[]) {
		    Scanner scanner = new Scanner(System.in);
		    
		    int n = scanner.nextInt();
		    String[] array = new String[n];
		    
		    for(int i = 0; i < n; i++) 
		    {
		    	array[i] = scanner.next();
		    }
		    int matigai = 0;
		    
		    for(int i = 0; i < n - 1; i++) 
		    {
		    	if(array[i].substring(array[i].length() - 1).equals(array[i+1].substring(0,1))) 
		    	{
		    		
		    	}
		    	else 
		    	{
		    		matigai++;
		    	}
		    }
		    for(int i = 0; i < n; i++) 
		    {
		    	for(int j = 0; j < i; j++) 
		    	{
		    		if(array[i].equals(array[j])) 
		    		{
		    			matigai++;
		    		}
		    	}
		    }
		    
		    if(matigai == 0) 
		    {
		    	System.out.println("Yes");
		    }
		    else 
		    {
		    	System.out.println("No");
		    }
		    
		    scanner.close(); }
		  } public class Main {
	  
	public static void main(String args[]) {
		    Scanner scanner = new Scanner(System.in);
		    
		    int n = scanner.nextInt();
		    String[] array = new String[n];
		    
		    for(int i = 0; i < n; i++) 
		    {
		    	array[i] = scanner.next();
		    }
		    int matigai = 0;
		    
		    for(int i = 0; i < n - 1; i++) 
		    {
		    	if(array[i].substring(array[i].length() - 1).equals(array[i+1].substring(0,1))) 
		    	{
		    		
		    	}
		    	else 
		    	{
		    		matigai++;
		    	}
		    }
		    for(int i = 0; i < n; i++) 
		    {
		    	for(int j = 0; j < i; j++) 
		    	{
		    		if(array[i].equals(array[j])) 
		    		{
		    			matigai++;
		    		}
		    	}
		    }
		    
		    if(matigai == 0) 
		    {
		    	System.out.println("Yes");
		    }
		    else 
		    {
		    	System.out.println("No");
		    }
		    
		    scanner.close(); }
		  } Main
import java.util.Scanner;

public class Main {
	  
	public static void main(String args[]) {
		    Scanner scanner = new Scanner(System.in);
		    
		    int n = scanner.nextInt();
		    String[] array = new String[n];
		    
		    for(int i = 0; i < n; i++) 
		    {
		    	array[i] = scanner.next();
		    }
		    int matigai = 0;
		    
		    for(int i = 0; i < n - 1; i++) 
		    {
		    	if(array[i].substring(array[i].length() - 1).equals(array[i+1].substring(0,1))) 
		    	{
		    		
		    	}
		    	else 
		    	{
		    		matigai++;
		    	}
		    }
		    for(int i = 0; i < n; i++) 
		    {
		    	for(int j = 0; j < i; j++) 
		    	{
		    		if(array[i].equals(array[j])) 
		    		{
		    			matigai++;
		    		}
		    	}
		    }
		    
		    if(matigai == 0) 
		    {
		    	System.out.println("Yes");
		    }
		    else 
		    {
		    	System.out.println("No");
		    }
		    
		    scanner.close(); }
		  }
