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

public class Main {
    public static void main(String args[]) {
        try (Scanner in = new Scanner(System.in)) {
            int N = in.nextInt();
            String[] W = new String[N];
            for (int i = 0; i < N; i++) {
                W[i] = in.next();
            }

            HashSet<String> used = new HashSet<>();
            used.add(W[0]);
            for (int i = 1; i < N; i++) {
                if (!used.add(W[i]) || !W[i - 1].substring(W[i - 1].length() - 1, W[i - 1].length()).equals(W[i].substring(0, 1))) {
                    System.out.println("No");
                    return;
                }
            }
            System.out.println("Yes");
        }
    }
} import java.util.HashSet; HashSet java.util import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String args[]) {
        try (Scanner in = new Scanner(System.in)) {
            int N = in.nextInt();
            String[] W = new String[N];
            for (int i = 0; i < N; i++) {
                W[i] = in.next();
            }

            HashSet<String> used = new HashSet<>();
            used.add(W[0]);
            for (int i = 1; i < N; i++) {
                if (!used.add(W[i]) || !W[i - 1].substring(W[i - 1].length() - 1, W[i - 1].length()).equals(W[i].substring(0, 1))) {
                    System.out.println("No");
                    return;
                }
            }
            System.out.println("Yes");
        }
    }
} Main public static void main(String args[]) {
        try (Scanner in = new Scanner(System.in)) {
            int N = in.nextInt();
            String[] W = new String[N];
            for (int i = 0; i < N; i++) {
                W[i] = in.next();
            }

            HashSet<String> used = new HashSet<>();
            used.add(W[0]);
            for (int i = 1; i < N; i++) {
                if (!used.add(W[i]) || !W[i - 1].substring(W[i - 1].length() - 1, W[i - 1].length()).equals(W[i].substring(0, 1))) {
                    System.out.println("No");
                    return;
                }
            }
            System.out.println("Yes");
        }
    } main {
        try (Scanner in = new Scanner(System.in)) {
            int N = in.nextInt();
            String[] W = new String[N];
            for (int i = 0; i < N; i++) {
                W[i] = in.next();
            }

            HashSet<String> used = new HashSet<>();
            used.add(W[0]);
            for (int i = 1; i < N; i++) {
                if (!used.add(W[i]) || !W[i - 1].substring(W[i - 1].length() - 1, W[i - 1].length()).equals(W[i].substring(0, 1))) {
                    System.out.println("No");
                    return;
                }
            }
            System.out.println("Yes");
        }
    } try (Scanner in = new Scanner(System.in)) {
            int N = in.nextInt();
            String[] W = new String[N];
            for (int i = 0; i < N; i++) {
                W[i] = in.next();
            }

            HashSet<String> used = new HashSet<>();
            used.add(W[0]);
            for (int i = 1; i < N; i++) {
                if (!used.add(W[i]) || !W[i - 1].substring(W[i - 1].length() - 1, W[i - 1].length()).equals(W[i].substring(0, 1))) {
                    System.out.println("No");
                    return;
                }
            }
            System.out.println("Yes");
        } {
            int N = in.nextInt();
            String[] W = new String[N];
            for (int i = 0; i < N; i++) {
                W[i] = in.next();
            }

            HashSet<String> used = new HashSet<>();
            used.add(W[0]);
            for (int i = 1; i < N; i++) {
                if (!used.add(W[i]) || !W[i - 1].substring(W[i - 1].length() - 1, W[i - 1].length()).equals(W[i].substring(0, 1))) {
                    System.out.println("No");
                    return;
                }
            }
            System.out.println("Yes");
        } Scanner in = new Scanner(System.in) Scanner in = new Scanner(System.in) new Scanner(System.in) int N = in.nextInt(); N in.nextInt() in.nextInt in String[] W = new String[N]; W new String[N] N for (int i = 0; i < N; i++) {
                W[i] = in.next();
            } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
                W[i] = in.next();
            } {
                W[i] = in.next();
            } W[i] = in.next() W[i] W i in.next() in.next in HashSet<String> used = new HashSet<>(); used new HashSet<>() used.add(W[0]) used.add used W[0] W 0 for (int i = 1; i < N; i++) {
                if (!used.add(W[i]) || !W[i - 1].substring(W[i - 1].length() - 1, W[i - 1].length()).equals(W[i].substring(0, 1))) {
                    System.out.println("No");
                    return;
                }
            } int i = 1; int i = 1; i 1 i < N i N i++ i++ i {
                if (!used.add(W[i]) || !W[i - 1].substring(W[i - 1].length() - 1, W[i - 1].length()).equals(W[i].substring(0, 1))) {
                    System.out.println("No");
                    return;
                }
            } {
                if (!used.add(W[i]) || !W[i - 1].substring(W[i - 1].length() - 1, W[i - 1].length()).equals(W[i].substring(0, 1))) {
                    System.out.println("No");
                    return;
                }
            } if (!used.add(W[i]) || !W[i - 1].substring(W[i - 1].length() - 1, W[i - 1].length()).equals(W[i].substring(0, 1))) {
                    System.out.println("No");
                    return;
                } !used.add(W[i]) || !W[i - 1].substring(W[i - 1].length() - 1, W[i - 1].length()).equals(W[i].substring(0, 1)) !used.add(W[i]) used.add(W[i]) used.add used W[i] W i !W[i - 1].substring(W[i - 1].length() - 1, W[i - 1].length()).equals(W[i].substring(0, 1)) W[i - 1].substring(W[i - 1].length() - 1, W[i - 1].length()).equals(W[i].substring(0, 1)) W[i - 1].substring(W[i - 1].length() - 1, W[i - 1].length()).equals W[i - 1].substring(W[i - 1].length() - 1, W[i - 1].length()) W[i - 1].substring W[i - 1] W i - 1 i 1 W[i - 1].length() - 1 W[i - 1].length() W[i - 1].length W[i - 1] W i - 1 i 1 1 W[i - 1].length() W[i - 1].length W[i - 1] W i - 1 i 1 W[i].substring(0, 1) W[i].substring W[i] W i 0 1 {
                    System.out.println("No");
                    return;
                } System.out.println("No") System.out.println System.out System System.out "No" return; System.out.println("Yes") System.out.println System.out System System.out "Yes" String args[] args public class Main {
    public static void main(String args[]) {
        try (Scanner in = new Scanner(System.in)) {
            int N = in.nextInt();
            String[] W = new String[N];
            for (int i = 0; i < N; i++) {
                W[i] = in.next();
            }

            HashSet<String> used = new HashSet<>();
            used.add(W[0]);
            for (int i = 1; i < N; i++) {
                if (!used.add(W[i]) || !W[i - 1].substring(W[i - 1].length() - 1, W[i - 1].length()).equals(W[i].substring(0, 1))) {
                    System.out.println("No");
                    return;
                }
            }
            System.out.println("Yes");
        }
    }
} public class Main {
    public static void main(String args[]) {
        try (Scanner in = new Scanner(System.in)) {
            int N = in.nextInt();
            String[] W = new String[N];
            for (int i = 0; i < N; i++) {
                W[i] = in.next();
            }

            HashSet<String> used = new HashSet<>();
            used.add(W[0]);
            for (int i = 1; i < N; i++) {
                if (!used.add(W[i]) || !W[i - 1].substring(W[i - 1].length() - 1, W[i - 1].length()).equals(W[i].substring(0, 1))) {
                    System.out.println("No");
                    return;
                }
            }
            System.out.println("Yes");
        }
    }
} Main
import java.util.HashSet;
import java.util.Scanner;

public class Main {
    public static void main(String args[]) {
        try (Scanner in = new Scanner(System.in)) {
            int N = in.nextInt();
            String[] W = new String[N];
            for (int i = 0; i < N; i++) {
                W[i] = in.next();
            }

            HashSet<String> used = new HashSet<>();
            used.add(W[0]);
            for (int i = 1; i < N; i++) {
                if (!used.add(W[i]) || !W[i - 1].substring(W[i - 1].length() - 1, W[i - 1].length()).equals(W[i].substring(0, 1))) {
                    System.out.println("No");
                    return;
                }
            }
            System.out.println("Yes");
        }
    }
}
