import java.util.*;
public class Main {

	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		int N = Integer.parseInt(input.nextLine());
		LinkedList<String> words = new LinkedList<String>();
		words.add(input.nextLine());
		boolean valid = true;
		for (int i = 1; i < N; i++) {
			String x = input.nextLine();
			String prev = words.get(i-1);
			if (words.contains(x)||x.charAt(0)!=prev.charAt(prev.length()-1)) {
				valid = false;
				break;
			}
			words.add(x);
		}
		System.out.println(valid? "Yes":"No");
	}
} import java.util.*; util.* java public class Main {

	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		int N = Integer.parseInt(input.nextLine());
		LinkedList<String> words = new LinkedList<String>();
		words.add(input.nextLine());
		boolean valid = true;
		for (int i = 1; i < N; i++) {
			String x = input.nextLine();
			String prev = words.get(i-1);
			if (words.contains(x)||x.charAt(0)!=prev.charAt(prev.length()-1)) {
				valid = false;
				break;
			}
			words.add(x);
		}
		System.out.println(valid? "Yes":"No");
	}
} Main public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		int N = Integer.parseInt(input.nextLine());
		LinkedList<String> words = new LinkedList<String>();
		words.add(input.nextLine());
		boolean valid = true;
		for (int i = 1; i < N; i++) {
			String x = input.nextLine();
			String prev = words.get(i-1);
			if (words.contains(x)||x.charAt(0)!=prev.charAt(prev.length()-1)) {
				valid = false;
				break;
			}
			words.add(x);
		}
		System.out.println(valid? "Yes":"No");
	} main {
		Scanner input = new Scanner(System.in);
		int N = Integer.parseInt(input.nextLine());
		LinkedList<String> words = new LinkedList<String>();
		words.add(input.nextLine());
		boolean valid = true;
		for (int i = 1; i < N; i++) {
			String x = input.nextLine();
			String prev = words.get(i-1);
			if (words.contains(x)||x.charAt(0)!=prev.charAt(prev.length()-1)) {
				valid = false;
				break;
			}
			words.add(x);
		}
		System.out.println(valid? "Yes":"No");
	} Scanner input = new Scanner(System.in); input new Scanner(System.in) int N = Integer.parseInt(input.nextLine()); N Integer.parseInt(input.nextLine()) Integer.parseInt Integer input.nextLine() input.nextLine input LinkedList<String> words = new LinkedList<String>(); words new LinkedList<String>() words.add(input.nextLine()) words.add words input.nextLine() input.nextLine input boolean valid = true; valid true for (int i = 1; i < N; i++) {
			String x = input.nextLine();
			String prev = words.get(i-1);
			if (words.contains(x)||x.charAt(0)!=prev.charAt(prev.length()-1)) {
				valid = false;
				break;
			}
			words.add(x);
		} int i = 1; int i = 1; i 1 i < N i N i++ i++ i {
			String x = input.nextLine();
			String prev = words.get(i-1);
			if (words.contains(x)||x.charAt(0)!=prev.charAt(prev.length()-1)) {
				valid = false;
				break;
			}
			words.add(x);
		} {
			String x = input.nextLine();
			String prev = words.get(i-1);
			if (words.contains(x)||x.charAt(0)!=prev.charAt(prev.length()-1)) {
				valid = false;
				break;
			}
			words.add(x);
		} String x = input.nextLine(); x input.nextLine() input.nextLine input String prev = words.get(i-1); prev words.get(i-1) words.get words i-1 i 1 if (words.contains(x)||x.charAt(0)!=prev.charAt(prev.length()-1)) {
				valid = false;
				break;
			} words.contains(x)||x.charAt(0)!=prev.charAt(prev.length()-1) words.contains(x) words.contains words x x.charAt(0)!=prev.charAt(prev.length()-1) x.charAt(0) x.charAt x 0 prev.charAt(prev.length()-1) prev.charAt prev prev.length()-1 prev.length() prev.length prev 1 {
				valid = false;
				break;
			} valid = false valid false break; words.add(x) words.add words x System.out.println(valid? "Yes":"No") System.out.println System.out System System.out valid? "Yes":"No" valid "Yes" "No" String[] args args public class Main {

	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		int N = Integer.parseInt(input.nextLine());
		LinkedList<String> words = new LinkedList<String>();
		words.add(input.nextLine());
		boolean valid = true;
		for (int i = 1; i < N; i++) {
			String x = input.nextLine();
			String prev = words.get(i-1);
			if (words.contains(x)||x.charAt(0)!=prev.charAt(prev.length()-1)) {
				valid = false;
				break;
			}
			words.add(x);
		}
		System.out.println(valid? "Yes":"No");
	}
} public class Main {

	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		int N = Integer.parseInt(input.nextLine());
		LinkedList<String> words = new LinkedList<String>();
		words.add(input.nextLine());
		boolean valid = true;
		for (int i = 1; i < N; i++) {
			String x = input.nextLine();
			String prev = words.get(i-1);
			if (words.contains(x)||x.charAt(0)!=prev.charAt(prev.length()-1)) {
				valid = false;
				break;
			}
			words.add(x);
		}
		System.out.println(valid? "Yes":"No");
	}
} Main
import java.util.*;
public class Main {

	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		int N = Integer.parseInt(input.nextLine());
		LinkedList<String> words = new LinkedList<String>();
		words.add(input.nextLine());
		boolean valid = true;
		for (int i = 1; i < N; i++) {
			String x = input.nextLine();
			String prev = words.get(i-1);
			if (words.contains(x)||x.charAt(0)!=prev.charAt(prev.length()-1)) {
				valid = false;
				break;
			}
			words.add(x);
		}
		System.out.println(valid? "Yes":"No");
	}
}