import java.util.HashSet;
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 = sc.nextInt();
        Set<String> set = new HashSet<>();
        String prev = sc.next();
        boolean isOk = true;
        for (int i = 1; i < n; i++) {
            set.add(prev);
            String current = sc.next();
            if (set.contains(current) || prev.charAt(prev.length() - 1) != current.charAt(0)) {
                isOk = false;
                break;
            }
            prev = current;
        }

        if (isOk) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }

        sc.close();
    }

} import java.util.HashSet; HashSet 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 = sc.nextInt();
        Set<String> set = new HashSet<>();
        String prev = sc.next();
        boolean isOk = true;
        for (int i = 1; i < n; i++) {
            set.add(prev);
            String current = sc.next();
            if (set.contains(current) || prev.charAt(prev.length() - 1) != current.charAt(0)) {
                isOk = false;
                break;
            }
            prev = current;
        }

        if (isOk) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }

        sc.close();
    }

} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Set<String> set = new HashSet<>();
        String prev = sc.next();
        boolean isOk = true;
        for (int i = 1; i < n; i++) {
            set.add(prev);
            String current = sc.next();
            if (set.contains(current) || prev.charAt(prev.length() - 1) != current.charAt(0)) {
                isOk = false;
                break;
            }
            prev = current;
        }

        if (isOk) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }

        sc.close();
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Set<String> set = new HashSet<>();
        String prev = sc.next();
        boolean isOk = true;
        for (int i = 1; i < n; i++) {
            set.add(prev);
            String current = sc.next();
            if (set.contains(current) || prev.charAt(prev.length() - 1) != current.charAt(0)) {
                isOk = false;
                break;
            }
            prev = current;
        }

        if (isOk) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }

        sc.close();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc Set<String> set = new HashSet<>(); set new HashSet<>() String prev = sc.next(); prev sc.next() sc.next sc boolean isOk = true; isOk true for (int i = 1; i < n; i++) {
            set.add(prev);
            String current = sc.next();
            if (set.contains(current) || prev.charAt(prev.length() - 1) != current.charAt(0)) {
                isOk = false;
                break;
            }
            prev = current;
        } int i = 1; int i = 1; i 1 i < n i n i++ i++ i {
            set.add(prev);
            String current = sc.next();
            if (set.contains(current) || prev.charAt(prev.length() - 1) != current.charAt(0)) {
                isOk = false;
                break;
            }
            prev = current;
        } {
            set.add(prev);
            String current = sc.next();
            if (set.contains(current) || prev.charAt(prev.length() - 1) != current.charAt(0)) {
                isOk = false;
                break;
            }
            prev = current;
        } set.add(prev) set.add set prev String current = sc.next(); current sc.next() sc.next sc if (set.contains(current) || prev.charAt(prev.length() - 1) != current.charAt(0)) {
                isOk = false;
                break;
            } set.contains(current) || prev.charAt(prev.length() - 1) != current.charAt(0) set.contains(current) set.contains set current prev.charAt(prev.length() - 1) != current.charAt(0) prev.charAt(prev.length() - 1) prev.charAt prev prev.length() - 1 prev.length() prev.length prev 1 current.charAt(0) current.charAt current 0 {
                isOk = false;
                break;
            } isOk = false isOk false break; prev = current prev current if (isOk) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        } isOk {
            System.out.println("Yes");
        } System.out.println("Yes") System.out.println System.out System System.out "Yes" {
            System.out.println("No");
        } System.out.println("No") System.out.println System.out System System.out "No" 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 = sc.nextInt();
        Set<String> set = new HashSet<>();
        String prev = sc.next();
        boolean isOk = true;
        for (int i = 1; i < n; i++) {
            set.add(prev);
            String current = sc.next();
            if (set.contains(current) || prev.charAt(prev.length() - 1) != current.charAt(0)) {
                isOk = false;
                break;
            }
            prev = current;
        }

        if (isOk) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }

        sc.close();
    }

} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Set<String> set = new HashSet<>();
        String prev = sc.next();
        boolean isOk = true;
        for (int i = 1; i < n; i++) {
            set.add(prev);
            String current = sc.next();
            if (set.contains(current) || prev.charAt(prev.length() - 1) != current.charAt(0)) {
                isOk = false;
                break;
            }
            prev = current;
        }

        if (isOk) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }

        sc.close();
    }

} Main
import java.util.HashSet;
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 = sc.nextInt();
        Set<String> set = new HashSet<>();
        String prev = sc.next();
        boolean isOk = true;
        for (int i = 1; i < n; i++) {
            set.add(prev);
            String current = sc.next();
            if (set.contains(current) || prev.charAt(prev.length() - 1) != current.charAt(0)) {
                isOk = false;
                break;
            }
            prev = current;
        }

        if (isOk) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }

        sc.close();
    }

}
