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> w = new HashSet<>();
        String[] ww = new String[n];
        for (int i = 0; i < n; i++) {
            ww[i] = sc.next();
        }
        w.add(ww[0]);
        for (int i = 0; i < n - 1; i++) {
            String tmp1 = ww[i].substring(ww[i].length() - 1, ww[i].length());
            String tmp2 = ww[i + 1].substring(0, 1);
            if(!tmp1.equals(tmp2)) {
                System.out.println("No");
                return;
            }
            w.add(ww[i + 1]);
        }
        if(w.size() == n) System.out.println("Yes");
        else System.out.println("No");
    }
} 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> w = new HashSet<>();
        String[] ww = new String[n];
        for (int i = 0; i < n; i++) {
            ww[i] = sc.next();
        }
        w.add(ww[0]);
        for (int i = 0; i < n - 1; i++) {
            String tmp1 = ww[i].substring(ww[i].length() - 1, ww[i].length());
            String tmp2 = ww[i + 1].substring(0, 1);
            if(!tmp1.equals(tmp2)) {
                System.out.println("No");
                return;
            }
            w.add(ww[i + 1]);
        }
        if(w.size() == n) System.out.println("Yes");
        else System.out.println("No");
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Set<String> w = new HashSet<>();
        String[] ww = new String[n];
        for (int i = 0; i < n; i++) {
            ww[i] = sc.next();
        }
        w.add(ww[0]);
        for (int i = 0; i < n - 1; i++) {
            String tmp1 = ww[i].substring(ww[i].length() - 1, ww[i].length());
            String tmp2 = ww[i + 1].substring(0, 1);
            if(!tmp1.equals(tmp2)) {
                System.out.println("No");
                return;
            }
            w.add(ww[i + 1]);
        }
        if(w.size() == n) System.out.println("Yes");
        else System.out.println("No");
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Set<String> w = new HashSet<>();
        String[] ww = new String[n];
        for (int i = 0; i < n; i++) {
            ww[i] = sc.next();
        }
        w.add(ww[0]);
        for (int i = 0; i < n - 1; i++) {
            String tmp1 = ww[i].substring(ww[i].length() - 1, ww[i].length());
            String tmp2 = ww[i + 1].substring(0, 1);
            if(!tmp1.equals(tmp2)) {
                System.out.println("No");
                return;
            }
            w.add(ww[i + 1]);
        }
        if(w.size() == n) System.out.println("Yes");
        else System.out.println("No");
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc Set<String> w = new HashSet<>(); w new HashSet<>() String[] ww = new String[n]; ww new String[n] n for (int i = 0; i < n; i++) {
            ww[i] = sc.next();
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            ww[i] = sc.next();
        } {
            ww[i] = sc.next();
        } ww[i] = sc.next() ww[i] ww i sc.next() sc.next sc w.add(ww[0]) w.add w ww[0] ww 0 for (int i = 0; i < n - 1; i++) {
            String tmp1 = ww[i].substring(ww[i].length() - 1, ww[i].length());
            String tmp2 = ww[i + 1].substring(0, 1);
            if(!tmp1.equals(tmp2)) {
                System.out.println("No");
                return;
            }
            w.add(ww[i + 1]);
        } int i = 0; int i = 0; i 0 i < n - 1 i n - 1 n 1 i++ i++ i {
            String tmp1 = ww[i].substring(ww[i].length() - 1, ww[i].length());
            String tmp2 = ww[i + 1].substring(0, 1);
            if(!tmp1.equals(tmp2)) {
                System.out.println("No");
                return;
            }
            w.add(ww[i + 1]);
        } {
            String tmp1 = ww[i].substring(ww[i].length() - 1, ww[i].length());
            String tmp2 = ww[i + 1].substring(0, 1);
            if(!tmp1.equals(tmp2)) {
                System.out.println("No");
                return;
            }
            w.add(ww[i + 1]);
        } String tmp1 = ww[i].substring(ww[i].length() - 1, ww[i].length()); tmp1 ww[i].substring(ww[i].length() - 1, ww[i].length()) ww[i].substring ww[i] ww i ww[i].length() - 1 ww[i].length() ww[i].length ww[i] ww i 1 ww[i].length() ww[i].length ww[i] ww i String tmp2 = ww[i + 1].substring(0, 1); tmp2 ww[i + 1].substring(0, 1) ww[i + 1].substring ww[i + 1] ww i + 1 i 1 0 1 if(!tmp1.equals(tmp2)) {
                System.out.println("No");
                return;
            } !tmp1.equals(tmp2) tmp1.equals(tmp2) tmp1.equals tmp1 tmp2 {
                System.out.println("No");
                return;
            } System.out.println("No") System.out.println System.out System System.out "No" return; w.add(ww[i + 1]) w.add w ww[i + 1] ww i + 1 i 1 if(w.size() == n) System.out.println("Yes");
        else System.out.println("No"); w.size() == n w.size() w.size w n System.out.println("Yes") System.out.println System.out System System.out "Yes" System.out.println("No") System.out.println System.out System System.out "No" String[] args args public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Set<String> w = new HashSet<>();
        String[] ww = new String[n];
        for (int i = 0; i < n; i++) {
            ww[i] = sc.next();
        }
        w.add(ww[0]);
        for (int i = 0; i < n - 1; i++) {
            String tmp1 = ww[i].substring(ww[i].length() - 1, ww[i].length());
            String tmp2 = ww[i + 1].substring(0, 1);
            if(!tmp1.equals(tmp2)) {
                System.out.println("No");
                return;
            }
            w.add(ww[i + 1]);
        }
        if(w.size() == n) System.out.println("Yes");
        else System.out.println("No");
    }
} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Set<String> w = new HashSet<>();
        String[] ww = new String[n];
        for (int i = 0; i < n; i++) {
            ww[i] = sc.next();
        }
        w.add(ww[0]);
        for (int i = 0; i < n - 1; i++) {
            String tmp1 = ww[i].substring(ww[i].length() - 1, ww[i].length());
            String tmp2 = ww[i + 1].substring(0, 1);
            if(!tmp1.equals(tmp2)) {
                System.out.println("No");
                return;
            }
            w.add(ww[i + 1]);
        }
        if(w.size() == n) System.out.println("Yes");
        else System.out.println("No");
    }
} 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> w = new HashSet<>();
        String[] ww = new String[n];
        for (int i = 0; i < n; i++) {
            ww[i] = sc.next();
        }
        w.add(ww[0]);
        for (int i = 0; i < n - 1; i++) {
            String tmp1 = ww[i].substring(ww[i].length() - 1, ww[i].length());
            String tmp2 = ww[i + 1].substring(0, 1);
            if(!tmp1.equals(tmp2)) {
                System.out.println("No");
                return;
            }
            w.add(ww[i + 1]);
        }
        if(w.size() == n) System.out.println("Yes");
        else System.out.println("No");
    }
}