import java.util.*;

public class Main {

    public static void main(String args[]) {

        // 入力
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        String[] w = new String[n];
        for (int i = 0; i < n; i++) {
            w[i] = sc.next();
        }

        // 主処理
        List<String> list = new ArrayList<>();
        list.add(w[0]);
        String next = String.valueOf(w[0].charAt(w[0].length() - 1));
        boolean judge = true;
        for (int i = 1; i < w.length; i++) {
            String head = String.valueOf(w[i].charAt(0));
            if (!next.equals(head) || list.contains(w[i])) {
                judge = false;
                break;
            }
            list.add(w[i]);
            next = String.valueOf(w[i].charAt(w[i].length() - 1));
        }
        String result = judge ? "Yes" : "No";

        // 出力
        System.out.println(result);
        sc.close();
    }
} import java.util.*; util.* java public class Main {

    public static void main(String args[]) {

        // 入力
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        String[] w = new String[n];
        for (int i = 0; i < n; i++) {
            w[i] = sc.next();
        }

        // 主処理
        List<String> list = new ArrayList<>();
        list.add(w[0]);
        String next = String.valueOf(w[0].charAt(w[0].length() - 1));
        boolean judge = true;
        for (int i = 1; i < w.length; i++) {
            String head = String.valueOf(w[i].charAt(0));
            if (!next.equals(head) || list.contains(w[i])) {
                judge = false;
                break;
            }
            list.add(w[i]);
            next = String.valueOf(w[i].charAt(w[i].length() - 1));
        }
        String result = judge ? "Yes" : "No";

        // 出力
        System.out.println(result);
        sc.close();
    }
} Main public static void main(String args[]) {

        // 入力
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        String[] w = new String[n];
        for (int i = 0; i < n; i++) {
            w[i] = sc.next();
        }

        // 主処理
        List<String> list = new ArrayList<>();
        list.add(w[0]);
        String next = String.valueOf(w[0].charAt(w[0].length() - 1));
        boolean judge = true;
        for (int i = 1; i < w.length; i++) {
            String head = String.valueOf(w[i].charAt(0));
            if (!next.equals(head) || list.contains(w[i])) {
                judge = false;
                break;
            }
            list.add(w[i]);
            next = String.valueOf(w[i].charAt(w[i].length() - 1));
        }
        String result = judge ? "Yes" : "No";

        // 出力
        System.out.println(result);
        sc.close();
    } main {

        // 入力
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        String[] w = new String[n];
        for (int i = 0; i < n; i++) {
            w[i] = sc.next();
        }

        // 主処理
        List<String> list = new ArrayList<>();
        list.add(w[0]);
        String next = String.valueOf(w[0].charAt(w[0].length() - 1));
        boolean judge = true;
        for (int i = 1; i < w.length; i++) {
            String head = String.valueOf(w[i].charAt(0));
            if (!next.equals(head) || list.contains(w[i])) {
                judge = false;
                break;
            }
            list.add(w[i]);
            next = String.valueOf(w[i].charAt(w[i].length() - 1));
        }
        String result = judge ? "Yes" : "No";

        // 出力
        System.out.println(result);
        sc.close();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = Integer.parseInt(sc.next()); n Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc String[] w = new String[n]; w new String[n] n for (int i = 0; i < n; i++) {
            w[i] = sc.next();
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            w[i] = sc.next();
        } {
            w[i] = sc.next();
        } w[i] = sc.next() w[i] w i sc.next() sc.next sc List<String> list = new ArrayList<>(); list new ArrayList<>() list.add(w[0]) list.add list w[0] w 0 String next = String.valueOf(w[0].charAt(w[0].length() - 1)); next String.valueOf(w[0].charAt(w[0].length() - 1)) String.valueOf String w[0].charAt(w[0].length() - 1) w[0].charAt w[0] w 0 w[0].length() - 1 w[0].length() w[0].length w[0] w 0 1 boolean judge = true; judge true for (int i = 1; i < w.length; i++) {
            String head = String.valueOf(w[i].charAt(0));
            if (!next.equals(head) || list.contains(w[i])) {
                judge = false;
                break;
            }
            list.add(w[i]);
            next = String.valueOf(w[i].charAt(w[i].length() - 1));
        } int i = 1; int i = 1; i 1 i < w.length i w.length w w.length i++ i++ i {
            String head = String.valueOf(w[i].charAt(0));
            if (!next.equals(head) || list.contains(w[i])) {
                judge = false;
                break;
            }
            list.add(w[i]);
            next = String.valueOf(w[i].charAt(w[i].length() - 1));
        } {
            String head = String.valueOf(w[i].charAt(0));
            if (!next.equals(head) || list.contains(w[i])) {
                judge = false;
                break;
            }
            list.add(w[i]);
            next = String.valueOf(w[i].charAt(w[i].length() - 1));
        } String head = String.valueOf(w[i].charAt(0)); head String.valueOf(w[i].charAt(0)) String.valueOf String w[i].charAt(0) w[i].charAt w[i] w i 0 if (!next.equals(head) || list.contains(w[i])) {
                judge = false;
                break;
            } !next.equals(head) || list.contains(w[i]) !next.equals(head) next.equals(head) next.equals next head list.contains(w[i]) list.contains list w[i] w i {
                judge = false;
                break;
            } judge = false judge false break; list.add(w[i]) list.add list w[i] w i next = String.valueOf(w[i].charAt(w[i].length() - 1)) next String.valueOf(w[i].charAt(w[i].length() - 1)) String.valueOf String w[i].charAt(w[i].length() - 1) w[i].charAt w[i] w i w[i].length() - 1 w[i].length() w[i].length w[i] w i 1 String result = judge ? "Yes" : "No"; result judge ? "Yes" : "No" judge "Yes" "No" System.out.println(result) System.out.println System.out System System.out result sc.close() sc.close sc String args[] args public class Main {

    public static void main(String args[]) {

        // 入力
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        String[] w = new String[n];
        for (int i = 0; i < n; i++) {
            w[i] = sc.next();
        }

        // 主処理
        List<String> list = new ArrayList<>();
        list.add(w[0]);
        String next = String.valueOf(w[0].charAt(w[0].length() - 1));
        boolean judge = true;
        for (int i = 1; i < w.length; i++) {
            String head = String.valueOf(w[i].charAt(0));
            if (!next.equals(head) || list.contains(w[i])) {
                judge = false;
                break;
            }
            list.add(w[i]);
            next = String.valueOf(w[i].charAt(w[i].length() - 1));
        }
        String result = judge ? "Yes" : "No";

        // 出力
        System.out.println(result);
        sc.close();
    }
} public class Main {

    public static void main(String args[]) {

        // 入力
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        String[] w = new String[n];
        for (int i = 0; i < n; i++) {
            w[i] = sc.next();
        }

        // 主処理
        List<String> list = new ArrayList<>();
        list.add(w[0]);
        String next = String.valueOf(w[0].charAt(w[0].length() - 1));
        boolean judge = true;
        for (int i = 1; i < w.length; i++) {
            String head = String.valueOf(w[i].charAt(0));
            if (!next.equals(head) || list.contains(w[i])) {
                judge = false;
                break;
            }
            list.add(w[i]);
            next = String.valueOf(w[i].charAt(w[i].length() - 1));
        }
        String result = judge ? "Yes" : "No";

        // 出力
        System.out.println(result);
        sc.close();
    }
} Main
import java.util.*;

public class Main {

    public static void main(String args[]) {

        // 入力
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        String[] w = new String[n];
        for (int i = 0; i < n; i++) {
            w[i] = sc.next();
        }

        // 主処理
        List<String> list = new ArrayList<>();
        list.add(w[0]);
        String next = String.valueOf(w[0].charAt(w[0].length() - 1));
        boolean judge = true;
        for (int i = 1; i < w.length; i++) {
            String head = String.valueOf(w[i].charAt(0));
            if (!next.equals(head) || list.contains(w[i])) {
                judge = false;
                break;
            }
            list.add(w[i]);
            next = String.valueOf(w[i].charAt(w[i].length() - 1));
        }
        String result = judge ? "Yes" : "No";

        // 出力
        System.out.println(result);
        sc.close();
    }
}
