
import java.util.*;

public class Main {

    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String pre = sc.next();
        HashMap<String, Integer> map = new HashMap<>();
        map.put(pre, 1);
        boolean ok = true;
        for (int i = 1; i < n; i++) {
            String tk = sc.next();
            if (pre.charAt(pre.length() - 1) != tk.charAt(0))
                ok = false;
            if (map.containsKey(tk))
                ok = false;
            map.put(tk, 1);
            pre = tk;
        }

        System.out.println(ok ? "Yes" : "No");

    }

} import java.util.*; util.* java public class Main {

    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String pre = sc.next();
        HashMap<String, Integer> map = new HashMap<>();
        map.put(pre, 1);
        boolean ok = true;
        for (int i = 1; i < n; i++) {
            String tk = sc.next();
            if (pre.charAt(pre.length() - 1) != tk.charAt(0))
                ok = false;
            if (map.containsKey(tk))
                ok = false;
            map.put(tk, 1);
            pre = tk;
        }

        System.out.println(ok ? "Yes" : "No");

    }

} Main public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String pre = sc.next();
        HashMap<String, Integer> map = new HashMap<>();
        map.put(pre, 1);
        boolean ok = true;
        for (int i = 1; i < n; i++) {
            String tk = sc.next();
            if (pre.charAt(pre.length() - 1) != tk.charAt(0))
                ok = false;
            if (map.containsKey(tk))
                ok = false;
            map.put(tk, 1);
            pre = tk;
        }

        System.out.println(ok ? "Yes" : "No");

    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String pre = sc.next();
        HashMap<String, Integer> map = new HashMap<>();
        map.put(pre, 1);
        boolean ok = true;
        for (int i = 1; i < n; i++) {
            String tk = sc.next();
            if (pre.charAt(pre.length() - 1) != tk.charAt(0))
                ok = false;
            if (map.containsKey(tk))
                ok = false;
            map.put(tk, 1);
            pre = tk;
        }

        System.out.println(ok ? "Yes" : "No");

    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc String pre = sc.next(); pre sc.next() sc.next sc HashMap<String, Integer> map = new HashMap<>(); map new HashMap<>() map.put(pre, 1) map.put map pre 1 boolean ok = true; ok true for (int i = 1; i < n; i++) {
            String tk = sc.next();
            if (pre.charAt(pre.length() - 1) != tk.charAt(0))
                ok = false;
            if (map.containsKey(tk))
                ok = false;
            map.put(tk, 1);
            pre = tk;
        } int i = 1; int i = 1; i 1 i < n i n i++ i++ i {
            String tk = sc.next();
            if (pre.charAt(pre.length() - 1) != tk.charAt(0))
                ok = false;
            if (map.containsKey(tk))
                ok = false;
            map.put(tk, 1);
            pre = tk;
        } {
            String tk = sc.next();
            if (pre.charAt(pre.length() - 1) != tk.charAt(0))
                ok = false;
            if (map.containsKey(tk))
                ok = false;
            map.put(tk, 1);
            pre = tk;
        } String tk = sc.next(); tk sc.next() sc.next sc if (pre.charAt(pre.length() - 1) != tk.charAt(0))
                ok = false; pre.charAt(pre.length() - 1) != tk.charAt(0) pre.charAt(pre.length() - 1) pre.charAt pre pre.length() - 1 pre.length() pre.length pre 1 tk.charAt(0) tk.charAt tk 0 ok = false ok false if (map.containsKey(tk))
                ok = false; map.containsKey(tk) map.containsKey map tk ok = false ok false map.put(tk, 1) map.put map tk 1 pre = tk pre tk System.out.println(ok ? "Yes" : "No") System.out.println System.out System System.out ok ? "Yes" : "No" ok "Yes" "No" String args[] args public class Main {

    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String pre = sc.next();
        HashMap<String, Integer> map = new HashMap<>();
        map.put(pre, 1);
        boolean ok = true;
        for (int i = 1; i < n; i++) {
            String tk = sc.next();
            if (pre.charAt(pre.length() - 1) != tk.charAt(0))
                ok = false;
            if (map.containsKey(tk))
                ok = false;
            map.put(tk, 1);
            pre = tk;
        }

        System.out.println(ok ? "Yes" : "No");

    }

} public class Main {

    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String pre = sc.next();
        HashMap<String, Integer> map = new HashMap<>();
        map.put(pre, 1);
        boolean ok = true;
        for (int i = 1; i < n; i++) {
            String tk = sc.next();
            if (pre.charAt(pre.length() - 1) != tk.charAt(0))
                ok = false;
            if (map.containsKey(tk))
                ok = false;
            map.put(tk, 1);
            pre = tk;
        }

        System.out.println(ok ? "Yes" : "No");

    }

} Main

import java.util.*;

public class Main {

    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String pre = sc.next();
        HashMap<String, Integer> map = new HashMap<>();
        map.put(pre, 1);
        boolean ok = true;
        for (int i = 1; i < n; i++) {
            String tk = sc.next();
            if (pre.charAt(pre.length() - 1) != tk.charAt(0))
                ok = false;
            if (map.containsKey(tk))
                ok = false;
            map.put(tk, 1);
            pre = tk;
        }

        System.out.println(ok ? "Yes" : "No");

    }

}
