import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = Integer.parseInt(scanner.nextLine());

        String previous = null;
        Set<String> seen = new HashSet<>();
        for (int i = 0; i < n; i++) {
            String line = scanner.nextLine();
            if (seen.contains(line)) {
                System.out.println("No");
                return;
            }
            seen.add(line);

            if (previous != null && previous.charAt(previous.length() - 1) != line.charAt(0)) {
                System.out.println("No");
                return;
            }
            previous = line;
        }
        System.out.println("Yes");
    }
} import java.util.*; util.* java class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = Integer.parseInt(scanner.nextLine());

        String previous = null;
        Set<String> seen = new HashSet<>();
        for (int i = 0; i < n; i++) {
            String line = scanner.nextLine();
            if (seen.contains(line)) {
                System.out.println("No");
                return;
            }
            seen.add(line);

            if (previous != null && previous.charAt(previous.length() - 1) != line.charAt(0)) {
                System.out.println("No");
                return;
            }
            previous = line;
        }
        System.out.println("Yes");
    }
} Main public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = Integer.parseInt(scanner.nextLine());

        String previous = null;
        Set<String> seen = new HashSet<>();
        for (int i = 0; i < n; i++) {
            String line = scanner.nextLine();
            if (seen.contains(line)) {
                System.out.println("No");
                return;
            }
            seen.add(line);

            if (previous != null && previous.charAt(previous.length() - 1) != line.charAt(0)) {
                System.out.println("No");
                return;
            }
            previous = line;
        }
        System.out.println("Yes");
    } main {
        Scanner scanner = new Scanner(System.in);
        int n = Integer.parseInt(scanner.nextLine());

        String previous = null;
        Set<String> seen = new HashSet<>();
        for (int i = 0; i < n; i++) {
            String line = scanner.nextLine();
            if (seen.contains(line)) {
                System.out.println("No");
                return;
            }
            seen.add(line);

            if (previous != null && previous.charAt(previous.length() - 1) != line.charAt(0)) {
                System.out.println("No");
                return;
            }
            previous = line;
        }
        System.out.println("Yes");
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int n = Integer.parseInt(scanner.nextLine()); n Integer.parseInt(scanner.nextLine()) Integer.parseInt Integer scanner.nextLine() scanner.nextLine scanner String previous = null; previous null Set<String> seen = new HashSet<>(); seen new HashSet<>() for (int i = 0; i < n; i++) {
            String line = scanner.nextLine();
            if (seen.contains(line)) {
                System.out.println("No");
                return;
            }
            seen.add(line);

            if (previous != null && previous.charAt(previous.length() - 1) != line.charAt(0)) {
                System.out.println("No");
                return;
            }
            previous = line;
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            String line = scanner.nextLine();
            if (seen.contains(line)) {
                System.out.println("No");
                return;
            }
            seen.add(line);

            if (previous != null && previous.charAt(previous.length() - 1) != line.charAt(0)) {
                System.out.println("No");
                return;
            }
            previous = line;
        } {
            String line = scanner.nextLine();
            if (seen.contains(line)) {
                System.out.println("No");
                return;
            }
            seen.add(line);

            if (previous != null && previous.charAt(previous.length() - 1) != line.charAt(0)) {
                System.out.println("No");
                return;
            }
            previous = line;
        } String line = scanner.nextLine(); line scanner.nextLine() scanner.nextLine scanner if (seen.contains(line)) {
                System.out.println("No");
                return;
            } seen.contains(line) seen.contains seen line {
                System.out.println("No");
                return;
            } System.out.println("No") System.out.println System.out System System.out "No" return; seen.add(line) seen.add seen line if (previous != null && previous.charAt(previous.length() - 1) != line.charAt(0)) {
                System.out.println("No");
                return;
            } previous != null && previous.charAt(previous.length() - 1) != line.charAt(0) previous != null previous null previous.charAt(previous.length() - 1) != line.charAt(0) previous.charAt(previous.length() - 1) previous.charAt previous previous.length() - 1 previous.length() previous.length previous 1 line.charAt(0) line.charAt line 0 {
                System.out.println("No");
                return;
            } System.out.println("No") System.out.println System.out System System.out "No" return; previous = line previous line System.out.println("Yes") System.out.println System.out System System.out "Yes" String[] args args
import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = Integer.parseInt(scanner.nextLine());

        String previous = null;
        Set<String> seen = new HashSet<>();
        for (int i = 0; i < n; i++) {
            String line = scanner.nextLine();
            if (seen.contains(line)) {
                System.out.println("No");
                return;
            }
            seen.add(line);

            if (previous != null && previous.charAt(previous.length() - 1) != line.charAt(0)) {
                System.out.println("No");
                return;
            }
            previous = line;
        }
        System.out.println("Yes");
    }
}
