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

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();
        }

        // 主処理
        Set<String> set = new HashSet<>(Arrays.asList(w));
        boolean isObey = set.size() == n;
        if (isObey) {
            for (int i = 0; i < n - 1; i++) {
                char end = w[i].charAt(w[i].length() - 1);
                char start = w[i + 1].charAt(0);
                isObey = isObey && (end == start);
            }
        }

        String result = isObey ? "Yes" : "No";

        // 出力
        System.out.println(result);
        sc.close();
    }
} import java.util.Arrays; Arrays java.util import java.util.HashSet; HashSet java.util import java.util.List; List 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[]) {

        // 入力
        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();
        }

        // 主処理
        Set<String> set = new HashSet<>(Arrays.asList(w));
        boolean isObey = set.size() == n;
        if (isObey) {
            for (int i = 0; i < n - 1; i++) {
                char end = w[i].charAt(w[i].length() - 1);
                char start = w[i + 1].charAt(0);
                isObey = isObey && (end == start);
            }
        }

        String result = isObey ? "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();
        }

        // 主処理
        Set<String> set = new HashSet<>(Arrays.asList(w));
        boolean isObey = set.size() == n;
        if (isObey) {
            for (int i = 0; i < n - 1; i++) {
                char end = w[i].charAt(w[i].length() - 1);
                char start = w[i + 1].charAt(0);
                isObey = isObey && (end == start);
            }
        }

        String result = isObey ? "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();
        }

        // 主処理
        Set<String> set = new HashSet<>(Arrays.asList(w));
        boolean isObey = set.size() == n;
        if (isObey) {
            for (int i = 0; i < n - 1; i++) {
                char end = w[i].charAt(w[i].length() - 1);
                char start = w[i + 1].charAt(0);
                isObey = isObey && (end == start);
            }
        }

        String result = isObey ? "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 Set<String> set = new HashSet<>(Arrays.asList(w)); set new HashSet<>(Arrays.asList(w)) boolean isObey = set.size() == n; isObey set.size() == n set.size() set.size set n if (isObey) {
            for (int i = 0; i < n - 1; i++) {
                char end = w[i].charAt(w[i].length() - 1);
                char start = w[i + 1].charAt(0);
                isObey = isObey && (end == start);
            }
        } isObey {
            for (int i = 0; i < n - 1; i++) {
                char end = w[i].charAt(w[i].length() - 1);
                char start = w[i + 1].charAt(0);
                isObey = isObey && (end == start);
            }
        } for (int i = 0; i < n - 1; i++) {
                char end = w[i].charAt(w[i].length() - 1);
                char start = w[i + 1].charAt(0);
                isObey = isObey && (end == start);
            } int i = 0; int i = 0; i 0 i < n - 1 i n - 1 n 1 i++ i++ i {
                char end = w[i].charAt(w[i].length() - 1);
                char start = w[i + 1].charAt(0);
                isObey = isObey && (end == start);
            } {
                char end = w[i].charAt(w[i].length() - 1);
                char start = w[i + 1].charAt(0);
                isObey = isObey && (end == start);
            } char end = w[i].charAt(w[i].length() - 1); end 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 char start = w[i + 1].charAt(0); start w[i + 1].charAt(0) w[i + 1].charAt w[i + 1] w i + 1 i 1 0 isObey = isObey && (end == start) isObey isObey && (end == start) isObey (end == start) end start String result = isObey ? "Yes" : "No"; result isObey ? "Yes" : "No" isObey "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();
        }

        // 主処理
        Set<String> set = new HashSet<>(Arrays.asList(w));
        boolean isObey = set.size() == n;
        if (isObey) {
            for (int i = 0; i < n - 1; i++) {
                char end = w[i].charAt(w[i].length() - 1);
                char start = w[i + 1].charAt(0);
                isObey = isObey && (end == start);
            }
        }

        String result = isObey ? "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();
        }

        // 主処理
        Set<String> set = new HashSet<>(Arrays.asList(w));
        boolean isObey = set.size() == n;
        if (isObey) {
            for (int i = 0; i < n - 1; i++) {
                char end = w[i].charAt(w[i].length() - 1);
                char start = w[i + 1].charAt(0);
                isObey = isObey && (end == start);
            }
        }

        String result = isObey ? "Yes" : "No";

        // 出力
        System.out.println(result);
        sc.close();
    }
} Main
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Scanner;
import java.util.Set;

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();
        }

        // 主処理
        Set<String> set = new HashSet<>(Arrays.asList(w));
        boolean isObey = set.size() == n;
        if (isObey) {
            for (int i = 0; i < n - 1; i++) {
                char end = w[i].charAt(w[i].length() - 1);
                char start = w[i + 1].charAt(0);
                isObey = isObey && (end == start);
            }
        }

        String result = isObey ? "Yes" : "No";

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