import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);

        HashMap<String, Boolean> wordlist = new HashMap<String, Boolean>();

        int N = scan.nextInt();
        String preword = scan.next();
        wordlist.put(preword, true);

        for (int i=1; i<N; i++) {
            String word = scan.next();

            if (wordlist.get(word) == null) {
                wordlist.put(word, true);
            } else {
                System.out.println("No");
                System.exit(0);
            }

            String end = preword.substring(preword.length()-1,preword.length());
            String start = word.substring(0,1);

            if (!end.equals(start)) {
                System.out.println("No");
                System.exit(0);
            }
            preword = word;
        }

        System.out.println("Yes");
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);

        HashMap<String, Boolean> wordlist = new HashMap<String, Boolean>();

        int N = scan.nextInt();
        String preword = scan.next();
        wordlist.put(preword, true);

        for (int i=1; i<N; i++) {
            String word = scan.next();

            if (wordlist.get(word) == null) {
                wordlist.put(word, true);
            } else {
                System.out.println("No");
                System.exit(0);
            }

            String end = preword.substring(preword.length()-1,preword.length());
            String start = word.substring(0,1);

            if (!end.equals(start)) {
                System.out.println("No");
                System.exit(0);
            }
            preword = word;
        }

        System.out.println("Yes");
    }
} Main public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);

        HashMap<String, Boolean> wordlist = new HashMap<String, Boolean>();

        int N = scan.nextInt();
        String preword = scan.next();
        wordlist.put(preword, true);

        for (int i=1; i<N; i++) {
            String word = scan.next();

            if (wordlist.get(word) == null) {
                wordlist.put(word, true);
            } else {
                System.out.println("No");
                System.exit(0);
            }

            String end = preword.substring(preword.length()-1,preword.length());
            String start = word.substring(0,1);

            if (!end.equals(start)) {
                System.out.println("No");
                System.exit(0);
            }
            preword = word;
        }

        System.out.println("Yes");
    } main {
        Scanner scan = new Scanner(System.in);

        HashMap<String, Boolean> wordlist = new HashMap<String, Boolean>();

        int N = scan.nextInt();
        String preword = scan.next();
        wordlist.put(preword, true);

        for (int i=1; i<N; i++) {
            String word = scan.next();

            if (wordlist.get(word) == null) {
                wordlist.put(word, true);
            } else {
                System.out.println("No");
                System.exit(0);
            }

            String end = preword.substring(preword.length()-1,preword.length());
            String start = word.substring(0,1);

            if (!end.equals(start)) {
                System.out.println("No");
                System.exit(0);
            }
            preword = word;
        }

        System.out.println("Yes");
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) HashMap<String, Boolean> wordlist = new HashMap<String, Boolean>(); wordlist new HashMap<String, Boolean>() int N = scan.nextInt(); N scan.nextInt() scan.nextInt scan String preword = scan.next(); preword scan.next() scan.next scan wordlist.put(preword, true) wordlist.put wordlist preword true for (int i=1; i<N; i++) {
            String word = scan.next();

            if (wordlist.get(word) == null) {
                wordlist.put(word, true);
            } else {
                System.out.println("No");
                System.exit(0);
            }

            String end = preword.substring(preword.length()-1,preword.length());
            String start = word.substring(0,1);

            if (!end.equals(start)) {
                System.out.println("No");
                System.exit(0);
            }
            preword = word;
        } int i=1; int i=1; i 1 i<N i N i++ i++ i {
            String word = scan.next();

            if (wordlist.get(word) == null) {
                wordlist.put(word, true);
            } else {
                System.out.println("No");
                System.exit(0);
            }

            String end = preword.substring(preword.length()-1,preword.length());
            String start = word.substring(0,1);

            if (!end.equals(start)) {
                System.out.println("No");
                System.exit(0);
            }
            preword = word;
        } {
            String word = scan.next();

            if (wordlist.get(word) == null) {
                wordlist.put(word, true);
            } else {
                System.out.println("No");
                System.exit(0);
            }

            String end = preword.substring(preword.length()-1,preword.length());
            String start = word.substring(0,1);

            if (!end.equals(start)) {
                System.out.println("No");
                System.exit(0);
            }
            preword = word;
        } String word = scan.next(); word scan.next() scan.next scan if (wordlist.get(word) == null) {
                wordlist.put(word, true);
            } else {
                System.out.println("No");
                System.exit(0);
            } wordlist.get(word) == null wordlist.get(word) wordlist.get wordlist word null {
                wordlist.put(word, true);
            } wordlist.put(word, true) wordlist.put wordlist word true {
                System.out.println("No");
                System.exit(0);
            } System.out.println("No") System.out.println System.out System System.out "No" System.exit(0) System.exit System 0 String end = preword.substring(preword.length()-1,preword.length()); end preword.substring(preword.length()-1,preword.length()) preword.substring preword preword.length()-1 preword.length() preword.length preword 1 preword.length() preword.length preword String start = word.substring(0,1); start word.substring(0,1) word.substring word 0 1 if (!end.equals(start)) {
                System.out.println("No");
                System.exit(0);
            } !end.equals(start) end.equals(start) end.equals end start {
                System.out.println("No");
                System.exit(0);
            } System.out.println("No") System.out.println System.out System System.out "No" System.exit(0) System.exit System 0 preword = word preword word 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) {
        Scanner scan = new Scanner(System.in);

        HashMap<String, Boolean> wordlist = new HashMap<String, Boolean>();

        int N = scan.nextInt();
        String preword = scan.next();
        wordlist.put(preword, true);

        for (int i=1; i<N; i++) {
            String word = scan.next();

            if (wordlist.get(word) == null) {
                wordlist.put(word, true);
            } else {
                System.out.println("No");
                System.exit(0);
            }

            String end = preword.substring(preword.length()-1,preword.length());
            String start = word.substring(0,1);

            if (!end.equals(start)) {
                System.out.println("No");
                System.exit(0);
            }
            preword = word;
        }

        System.out.println("Yes");
    }
} public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);

        HashMap<String, Boolean> wordlist = new HashMap<String, Boolean>();

        int N = scan.nextInt();
        String preword = scan.next();
        wordlist.put(preword, true);

        for (int i=1; i<N; i++) {
            String word = scan.next();

            if (wordlist.get(word) == null) {
                wordlist.put(word, true);
            } else {
                System.out.println("No");
                System.exit(0);
            }

            String end = preword.substring(preword.length()-1,preword.length());
            String start = word.substring(0,1);

            if (!end.equals(start)) {
                System.out.println("No");
                System.exit(0);
            }
            preword = word;
        }

        System.out.println("Yes");
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);

        HashMap<String, Boolean> wordlist = new HashMap<String, Boolean>();

        int N = scan.nextInt();
        String preword = scan.next();
        wordlist.put(preword, true);

        for (int i=1; i<N; i++) {
            String word = scan.next();

            if (wordlist.get(word) == null) {
                wordlist.put(word, true);
            } else {
                System.out.println("No");
                System.exit(0);
            }

            String end = preword.substring(preword.length()-1,preword.length());
            String start = word.substring(0,1);

            if (!end.equals(start)) {
                System.out.println("No");
                System.exit(0);
            }
            preword = word;
        }

        System.out.println("Yes");
    }
}
