import java.net.SecureCacheResponse;
import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String[] list = new String[n];
        HashMap<String, Integer> map = new HashMap<>();

        for (int i = 0; i < n; i++) {
            String tmpStr = sc.next();
            list[i] = tmpStr;

            if (map.containsKey(tmpStr)) {
                map.put(tmpStr, map.get(tmpStr)+1);
            } else {
                map.put(tmpStr, 1);
            }
        }

        boolean ans = true;
        for (int i = 1; i < n; i++) {
            String pre = list[i-1];
            String cur = list[i];

            if (pre.charAt(pre.length()-1) == cur.charAt(0) && map.get(cur) == 1) {
                continue;
            } else {
                ans = false;
                break;
            }
        }

        System.out.println(ans ? "Yes" : "No");
    }
} import java.net.SecureCacheResponse; SecureCacheResponse java.net 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[] list = new String[n];
        HashMap<String, Integer> map = new HashMap<>();

        for (int i = 0; i < n; i++) {
            String tmpStr = sc.next();
            list[i] = tmpStr;

            if (map.containsKey(tmpStr)) {
                map.put(tmpStr, map.get(tmpStr)+1);
            } else {
                map.put(tmpStr, 1);
            }
        }

        boolean ans = true;
        for (int i = 1; i < n; i++) {
            String pre = list[i-1];
            String cur = list[i];

            if (pre.charAt(pre.length()-1) == cur.charAt(0) && map.get(cur) == 1) {
                continue;
            } else {
                ans = false;
                break;
            }
        }

        System.out.println(ans ? "Yes" : "No");
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String[] list = new String[n];
        HashMap<String, Integer> map = new HashMap<>();

        for (int i = 0; i < n; i++) {
            String tmpStr = sc.next();
            list[i] = tmpStr;

            if (map.containsKey(tmpStr)) {
                map.put(tmpStr, map.get(tmpStr)+1);
            } else {
                map.put(tmpStr, 1);
            }
        }

        boolean ans = true;
        for (int i = 1; i < n; i++) {
            String pre = list[i-1];
            String cur = list[i];

            if (pre.charAt(pre.length()-1) == cur.charAt(0) && map.get(cur) == 1) {
                continue;
            } else {
                ans = false;
                break;
            }
        }

        System.out.println(ans ? "Yes" : "No");
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String[] list = new String[n];
        HashMap<String, Integer> map = new HashMap<>();

        for (int i = 0; i < n; i++) {
            String tmpStr = sc.next();
            list[i] = tmpStr;

            if (map.containsKey(tmpStr)) {
                map.put(tmpStr, map.get(tmpStr)+1);
            } else {
                map.put(tmpStr, 1);
            }
        }

        boolean ans = true;
        for (int i = 1; i < n; i++) {
            String pre = list[i-1];
            String cur = list[i];

            if (pre.charAt(pre.length()-1) == cur.charAt(0) && map.get(cur) == 1) {
                continue;
            } else {
                ans = false;
                break;
            }
        }

        System.out.println(ans ? "Yes" : "No");
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc String[] list = new String[n]; list new String[n] n HashMap<String, Integer> map = new HashMap<>(); map new HashMap<>() for (int i = 0; i < n; i++) {
            String tmpStr = sc.next();
            list[i] = tmpStr;

            if (map.containsKey(tmpStr)) {
                map.put(tmpStr, map.get(tmpStr)+1);
            } else {
                map.put(tmpStr, 1);
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            String tmpStr = sc.next();
            list[i] = tmpStr;

            if (map.containsKey(tmpStr)) {
                map.put(tmpStr, map.get(tmpStr)+1);
            } else {
                map.put(tmpStr, 1);
            }
        } {
            String tmpStr = sc.next();
            list[i] = tmpStr;

            if (map.containsKey(tmpStr)) {
                map.put(tmpStr, map.get(tmpStr)+1);
            } else {
                map.put(tmpStr, 1);
            }
        } String tmpStr = sc.next(); tmpStr sc.next() sc.next sc list[i] = tmpStr list[i] list i tmpStr if (map.containsKey(tmpStr)) {
                map.put(tmpStr, map.get(tmpStr)+1);
            } else {
                map.put(tmpStr, 1);
            } map.containsKey(tmpStr) map.containsKey map tmpStr {
                map.put(tmpStr, map.get(tmpStr)+1);
            } map.put(tmpStr, map.get(tmpStr)+1) map.put map tmpStr map.get(tmpStr)+1 map.get(tmpStr) map.get map tmpStr 1 {
                map.put(tmpStr, 1);
            } map.put(tmpStr, 1) map.put map tmpStr 1 boolean ans = true; ans true for (int i = 1; i < n; i++) {
            String pre = list[i-1];
            String cur = list[i];

            if (pre.charAt(pre.length()-1) == cur.charAt(0) && map.get(cur) == 1) {
                continue;
            } else {
                ans = false;
                break;
            }
        } int i = 1; int i = 1; i 1 i < n i n i++ i++ i {
            String pre = list[i-1];
            String cur = list[i];

            if (pre.charAt(pre.length()-1) == cur.charAt(0) && map.get(cur) == 1) {
                continue;
            } else {
                ans = false;
                break;
            }
        } {
            String pre = list[i-1];
            String cur = list[i];

            if (pre.charAt(pre.length()-1) == cur.charAt(0) && map.get(cur) == 1) {
                continue;
            } else {
                ans = false;
                break;
            }
        } String pre = list[i-1]; pre list[i-1] list i-1 i 1 String cur = list[i]; cur list[i] list i if (pre.charAt(pre.length()-1) == cur.charAt(0) && map.get(cur) == 1) {
                continue;
            } else {
                ans = false;
                break;
            } pre.charAt(pre.length()-1) == cur.charAt(0) && map.get(cur) == 1 pre.charAt(pre.length()-1) == cur.charAt(0) pre.charAt(pre.length()-1) pre.charAt pre pre.length()-1 pre.length() pre.length pre 1 cur.charAt(0) cur.charAt cur 0 map.get(cur) == 1 map.get(cur) map.get map cur 1 {
                continue;
            } continue; {
                ans = false;
                break;
            } ans = false ans false break; System.out.println(ans ? "Yes" : "No") System.out.println System.out System System.out ans ? "Yes" : "No" ans "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[] list = new String[n];
        HashMap<String, Integer> map = new HashMap<>();

        for (int i = 0; i < n; i++) {
            String tmpStr = sc.next();
            list[i] = tmpStr;

            if (map.containsKey(tmpStr)) {
                map.put(tmpStr, map.get(tmpStr)+1);
            } else {
                map.put(tmpStr, 1);
            }
        }

        boolean ans = true;
        for (int i = 1; i < n; i++) {
            String pre = list[i-1];
            String cur = list[i];

            if (pre.charAt(pre.length()-1) == cur.charAt(0) && map.get(cur) == 1) {
                continue;
            } else {
                ans = false;
                break;
            }
        }

        System.out.println(ans ? "Yes" : "No");
    }
} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String[] list = new String[n];
        HashMap<String, Integer> map = new HashMap<>();

        for (int i = 0; i < n; i++) {
            String tmpStr = sc.next();
            list[i] = tmpStr;

            if (map.containsKey(tmpStr)) {
                map.put(tmpStr, map.get(tmpStr)+1);
            } else {
                map.put(tmpStr, 1);
            }
        }

        boolean ans = true;
        for (int i = 1; i < n; i++) {
            String pre = list[i-1];
            String cur = list[i];

            if (pre.charAt(pre.length()-1) == cur.charAt(0) && map.get(cur) == 1) {
                continue;
            } else {
                ans = false;
                break;
            }
        }

        System.out.println(ans ? "Yes" : "No");
    }
} Main
import java.net.SecureCacheResponse;
import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String[] list = new String[n];
        HashMap<String, Integer> map = new HashMap<>();

        for (int i = 0; i < n; i++) {
            String tmpStr = sc.next();
            list[i] = tmpStr;

            if (map.containsKey(tmpStr)) {
                map.put(tmpStr, map.get(tmpStr)+1);
            } else {
                map.put(tmpStr, 1);
            }
        }

        boolean ans = true;
        for (int i = 1; i < n; i++) {
            String pre = list[i-1];
            String cur = list[i];

            if (pre.charAt(pre.length()-1) == cur.charAt(0) && map.get(cur) == 1) {
                continue;
            } else {
                ans = false;
                break;
            }
        }

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