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

public class Main {

	public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			int n = scanner.nextInt();
			String prev = null;
			boolean shiritori = true;
			Set<String> set = new HashSet<>();
			for (int i = 0; i < n; i++) {
				String w = scanner.next();
				if (shiritori) {
					if (null != prev) {
						if (prev.charAt(prev.length() - 1) != w.charAt(0)) {
							shiritori = false;
						}
					}
				}
				set.add(w);
				prev = w;
			}
			System.out.println((shiritori && (set.size() == n)) ? "Yes" : "No");
		}
	}
} 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[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			int n = scanner.nextInt();
			String prev = null;
			boolean shiritori = true;
			Set<String> set = new HashSet<>();
			for (int i = 0; i < n; i++) {
				String w = scanner.next();
				if (shiritori) {
					if (null != prev) {
						if (prev.charAt(prev.length() - 1) != w.charAt(0)) {
							shiritori = false;
						}
					}
				}
				set.add(w);
				prev = w;
			}
			System.out.println((shiritori && (set.size() == n)) ? "Yes" : "No");
		}
	}
} Main public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			int n = scanner.nextInt();
			String prev = null;
			boolean shiritori = true;
			Set<String> set = new HashSet<>();
			for (int i = 0; i < n; i++) {
				String w = scanner.next();
				if (shiritori) {
					if (null != prev) {
						if (prev.charAt(prev.length() - 1) != w.charAt(0)) {
							shiritori = false;
						}
					}
				}
				set.add(w);
				prev = w;
			}
			System.out.println((shiritori && (set.size() == n)) ? "Yes" : "No");
		}
	} main {
		try (Scanner scanner = new Scanner(System.in)) {
			int n = scanner.nextInt();
			String prev = null;
			boolean shiritori = true;
			Set<String> set = new HashSet<>();
			for (int i = 0; i < n; i++) {
				String w = scanner.next();
				if (shiritori) {
					if (null != prev) {
						if (prev.charAt(prev.length() - 1) != w.charAt(0)) {
							shiritori = false;
						}
					}
				}
				set.add(w);
				prev = w;
			}
			System.out.println((shiritori && (set.size() == n)) ? "Yes" : "No");
		}
	} try (Scanner scanner = new Scanner(System.in)) {
			int n = scanner.nextInt();
			String prev = null;
			boolean shiritori = true;
			Set<String> set = new HashSet<>();
			for (int i = 0; i < n; i++) {
				String w = scanner.next();
				if (shiritori) {
					if (null != prev) {
						if (prev.charAt(prev.length() - 1) != w.charAt(0)) {
							shiritori = false;
						}
					}
				}
				set.add(w);
				prev = w;
			}
			System.out.println((shiritori && (set.size() == n)) ? "Yes" : "No");
		} {
			int n = scanner.nextInt();
			String prev = null;
			boolean shiritori = true;
			Set<String> set = new HashSet<>();
			for (int i = 0; i < n; i++) {
				String w = scanner.next();
				if (shiritori) {
					if (null != prev) {
						if (prev.charAt(prev.length() - 1) != w.charAt(0)) {
							shiritori = false;
						}
					}
				}
				set.add(w);
				prev = w;
			}
			System.out.println((shiritori && (set.size() == n)) ? "Yes" : "No");
		} Scanner scanner = new Scanner(System.in) Scanner scanner = new Scanner(System.in) new Scanner(System.in) int n = scanner.nextInt(); n scanner.nextInt() scanner.nextInt scanner String prev = null; prev null boolean shiritori = true; shiritori true Set<String> set = new HashSet<>(); set new HashSet<>() for (int i = 0; i < n; i++) {
				String w = scanner.next();
				if (shiritori) {
					if (null != prev) {
						if (prev.charAt(prev.length() - 1) != w.charAt(0)) {
							shiritori = false;
						}
					}
				}
				set.add(w);
				prev = w;
			} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
				String w = scanner.next();
				if (shiritori) {
					if (null != prev) {
						if (prev.charAt(prev.length() - 1) != w.charAt(0)) {
							shiritori = false;
						}
					}
				}
				set.add(w);
				prev = w;
			} {
				String w = scanner.next();
				if (shiritori) {
					if (null != prev) {
						if (prev.charAt(prev.length() - 1) != w.charAt(0)) {
							shiritori = false;
						}
					}
				}
				set.add(w);
				prev = w;
			} String w = scanner.next(); w scanner.next() scanner.next scanner if (shiritori) {
					if (null != prev) {
						if (prev.charAt(prev.length() - 1) != w.charAt(0)) {
							shiritori = false;
						}
					}
				} shiritori {
					if (null != prev) {
						if (prev.charAt(prev.length() - 1) != w.charAt(0)) {
							shiritori = false;
						}
					}
				} if (null != prev) {
						if (prev.charAt(prev.length() - 1) != w.charAt(0)) {
							shiritori = false;
						}
					} null != prev null prev {
						if (prev.charAt(prev.length() - 1) != w.charAt(0)) {
							shiritori = false;
						}
					} if (prev.charAt(prev.length() - 1) != w.charAt(0)) {
							shiritori = false;
						} prev.charAt(prev.length() - 1) != w.charAt(0) prev.charAt(prev.length() - 1) prev.charAt prev prev.length() - 1 prev.length() prev.length prev 1 w.charAt(0) w.charAt w 0 {
							shiritori = false;
						} shiritori = false shiritori false set.add(w) set.add set w prev = w prev w System.out.println((shiritori && (set.size() == n)) ? "Yes" : "No") System.out.println System.out System System.out (shiritori && (set.size() == n)) ? "Yes" : "No" (shiritori && (set.size() == n)) shiritori (set.size() == n) set.size() set.size set n "Yes" "No" String[] args args public class Main {

	public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			int n = scanner.nextInt();
			String prev = null;
			boolean shiritori = true;
			Set<String> set = new HashSet<>();
			for (int i = 0; i < n; i++) {
				String w = scanner.next();
				if (shiritori) {
					if (null != prev) {
						if (prev.charAt(prev.length() - 1) != w.charAt(0)) {
							shiritori = false;
						}
					}
				}
				set.add(w);
				prev = w;
			}
			System.out.println((shiritori && (set.size() == n)) ? "Yes" : "No");
		}
	}
} public class Main {

	public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			int n = scanner.nextInt();
			String prev = null;
			boolean shiritori = true;
			Set<String> set = new HashSet<>();
			for (int i = 0; i < n; i++) {
				String w = scanner.next();
				if (shiritori) {
					if (null != prev) {
						if (prev.charAt(prev.length() - 1) != w.charAt(0)) {
							shiritori = false;
						}
					}
				}
				set.add(w);
				prev = w;
			}
			System.out.println((shiritori && (set.size() == n)) ? "Yes" : "No");
		}
	}
} Main
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Main {

	public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			int n = scanner.nextInt();
			String prev = null;
			boolean shiritori = true;
			Set<String> set = new HashSet<>();
			for (int i = 0; i < n; i++) {
				String w = scanner.next();
				if (shiritori) {
					if (null != prev) {
						if (prev.charAt(prev.length() - 1) != w.charAt(0)) {
							shiritori = false;
						}
					}
				}
				set.add(w);
				prev = w;
			}
			System.out.println((shiritori && (set.size() == n)) ? "Yes" : "No");
		}
	}
}
