import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Main {

	public static void main(String[] main) {
		Scanner sc = new Scanner(System.in);
		int numOfWord = Integer.parseInt(sc.nextLine());
		
		Set<String> wordSet = new HashSet<>();
		boolean followTheRules = true;
		String prevEndChar = null;
		for (int i= 0; i < numOfWord; i++) {
			String word = sc.nextLine();
			
			if (wordSet.contains(word)) {
				followTheRules = false;
				break;
			}
			if (prevEndChar != null && !prevEndChar.equals(String.valueOf(word.charAt(0)))) {
				followTheRules = false;
				break;
			}
			prevEndChar = String.valueOf(word.charAt(word.length() -1));
			wordSet.add(word);
		}
		
		String result = followTheRules ? "Yes" : "No";
		System.out.println(result);
	}
} import java.util.HashSet; HashSet java.util import java.util.Scanner; Scanner java.util import java.util.Set; Set java.util public class Main {

	public static void main(String[] main) {
		Scanner sc = new Scanner(System.in);
		int numOfWord = Integer.parseInt(sc.nextLine());
		
		Set<String> wordSet = new HashSet<>();
		boolean followTheRules = true;
		String prevEndChar = null;
		for (int i= 0; i < numOfWord; i++) {
			String word = sc.nextLine();
			
			if (wordSet.contains(word)) {
				followTheRules = false;
				break;
			}
			if (prevEndChar != null && !prevEndChar.equals(String.valueOf(word.charAt(0)))) {
				followTheRules = false;
				break;
			}
			prevEndChar = String.valueOf(word.charAt(word.length() -1));
			wordSet.add(word);
		}
		
		String result = followTheRules ? "Yes" : "No";
		System.out.println(result);
	}
} Main public static void main(String[] main) {
		Scanner sc = new Scanner(System.in);
		int numOfWord = Integer.parseInt(sc.nextLine());
		
		Set<String> wordSet = new HashSet<>();
		boolean followTheRules = true;
		String prevEndChar = null;
		for (int i= 0; i < numOfWord; i++) {
			String word = sc.nextLine();
			
			if (wordSet.contains(word)) {
				followTheRules = false;
				break;
			}
			if (prevEndChar != null && !prevEndChar.equals(String.valueOf(word.charAt(0)))) {
				followTheRules = false;
				break;
			}
			prevEndChar = String.valueOf(word.charAt(word.length() -1));
			wordSet.add(word);
		}
		
		String result = followTheRules ? "Yes" : "No";
		System.out.println(result);
	} main {
		Scanner sc = new Scanner(System.in);
		int numOfWord = Integer.parseInt(sc.nextLine());
		
		Set<String> wordSet = new HashSet<>();
		boolean followTheRules = true;
		String prevEndChar = null;
		for (int i= 0; i < numOfWord; i++) {
			String word = sc.nextLine();
			
			if (wordSet.contains(word)) {
				followTheRules = false;
				break;
			}
			if (prevEndChar != null && !prevEndChar.equals(String.valueOf(word.charAt(0)))) {
				followTheRules = false;
				break;
			}
			prevEndChar = String.valueOf(word.charAt(word.length() -1));
			wordSet.add(word);
		}
		
		String result = followTheRules ? "Yes" : "No";
		System.out.println(result);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int numOfWord = Integer.parseInt(sc.nextLine()); numOfWord Integer.parseInt(sc.nextLine()) Integer.parseInt Integer sc.nextLine() sc.nextLine sc Set<String> wordSet = new HashSet<>(); wordSet new HashSet<>() boolean followTheRules = true; followTheRules true String prevEndChar = null; prevEndChar null for (int i= 0; i < numOfWord; i++) {
			String word = sc.nextLine();
			
			if (wordSet.contains(word)) {
				followTheRules = false;
				break;
			}
			if (prevEndChar != null && !prevEndChar.equals(String.valueOf(word.charAt(0)))) {
				followTheRules = false;
				break;
			}
			prevEndChar = String.valueOf(word.charAt(word.length() -1));
			wordSet.add(word);
		} int i= 0; int i= 0; i 0 i < numOfWord i numOfWord i++ i++ i {
			String word = sc.nextLine();
			
			if (wordSet.contains(word)) {
				followTheRules = false;
				break;
			}
			if (prevEndChar != null && !prevEndChar.equals(String.valueOf(word.charAt(0)))) {
				followTheRules = false;
				break;
			}
			prevEndChar = String.valueOf(word.charAt(word.length() -1));
			wordSet.add(word);
		} {
			String word = sc.nextLine();
			
			if (wordSet.contains(word)) {
				followTheRules = false;
				break;
			}
			if (prevEndChar != null && !prevEndChar.equals(String.valueOf(word.charAt(0)))) {
				followTheRules = false;
				break;
			}
			prevEndChar = String.valueOf(word.charAt(word.length() -1));
			wordSet.add(word);
		} String word = sc.nextLine(); word sc.nextLine() sc.nextLine sc if (wordSet.contains(word)) {
				followTheRules = false;
				break;
			} wordSet.contains(word) wordSet.contains wordSet word {
				followTheRules = false;
				break;
			} followTheRules = false followTheRules false break; if (prevEndChar != null && !prevEndChar.equals(String.valueOf(word.charAt(0)))) {
				followTheRules = false;
				break;
			} prevEndChar != null && !prevEndChar.equals(String.valueOf(word.charAt(0))) prevEndChar != null prevEndChar null !prevEndChar.equals(String.valueOf(word.charAt(0))) prevEndChar.equals(String.valueOf(word.charAt(0))) prevEndChar.equals prevEndChar String.valueOf(word.charAt(0)) String.valueOf String word.charAt(0) word.charAt word 0 {
				followTheRules = false;
				break;
			} followTheRules = false followTheRules false break; prevEndChar = String.valueOf(word.charAt(word.length() -1)) prevEndChar String.valueOf(word.charAt(word.length() -1)) String.valueOf String word.charAt(word.length() -1) word.charAt word word.length() -1 word.length() word.length word 1 wordSet.add(word) wordSet.add wordSet word String result = followTheRules ? "Yes" : "No"; result followTheRules ? "Yes" : "No" followTheRules "Yes" "No" System.out.println(result) System.out.println System.out System System.out result String[] main main public class Main {

	public static void main(String[] main) {
		Scanner sc = new Scanner(System.in);
		int numOfWord = Integer.parseInt(sc.nextLine());
		
		Set<String> wordSet = new HashSet<>();
		boolean followTheRules = true;
		String prevEndChar = null;
		for (int i= 0; i < numOfWord; i++) {
			String word = sc.nextLine();
			
			if (wordSet.contains(word)) {
				followTheRules = false;
				break;
			}
			if (prevEndChar != null && !prevEndChar.equals(String.valueOf(word.charAt(0)))) {
				followTheRules = false;
				break;
			}
			prevEndChar = String.valueOf(word.charAt(word.length() -1));
			wordSet.add(word);
		}
		
		String result = followTheRules ? "Yes" : "No";
		System.out.println(result);
	}
} public class Main {

	public static void main(String[] main) {
		Scanner sc = new Scanner(System.in);
		int numOfWord = Integer.parseInt(sc.nextLine());
		
		Set<String> wordSet = new HashSet<>();
		boolean followTheRules = true;
		String prevEndChar = null;
		for (int i= 0; i < numOfWord; i++) {
			String word = sc.nextLine();
			
			if (wordSet.contains(word)) {
				followTheRules = false;
				break;
			}
			if (prevEndChar != null && !prevEndChar.equals(String.valueOf(word.charAt(0)))) {
				followTheRules = false;
				break;
			}
			prevEndChar = String.valueOf(word.charAt(word.length() -1));
			wordSet.add(word);
		}
		
		String result = followTheRules ? "Yes" : "No";
		System.out.println(result);
	}
} Main
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Main {

	public static void main(String[] main) {
		Scanner sc = new Scanner(System.in);
		int numOfWord = Integer.parseInt(sc.nextLine());
		
		Set<String> wordSet = new HashSet<>();
		boolean followTheRules = true;
		String prevEndChar = null;
		for (int i= 0; i < numOfWord; i++) {
			String word = sc.nextLine();
			
			if (wordSet.contains(word)) {
				followTheRules = false;
				break;
			}
			if (prevEndChar != null && !prevEndChar.equals(String.valueOf(word.charAt(0)))) {
				followTheRules = false;
				break;
			}
			prevEndChar = String.valueOf(word.charAt(word.length() -1));
			wordSet.add(word);
		}
		
		String result = followTheRules ? "Yes" : "No";
		System.out.println(result);
	}
}