import java.util.*;
import static java.lang.System.*;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(in);
        int N;
        N = scanner.nextInt();
        HashMap<String, Boolean> seen = new HashMap<>();
        String[] words = new String[N+1];
        for(int i = 0; i < N; ++i) {
            words[i] = scanner.next();
        }
        String ans = "Yes";
        for(int i = 1; i < N; ++i) {
            seen.put(words[i-1], true);
            if(words[i].charAt(0) != words[i-1].charAt(words[i-1].length()-1))
                ans = "No";
            if(seen.containsKey(words[i]))
                ans = "No";
        }
        System.out.println(ans);
    }
} import java.util.*; util.* java import static java.lang.System.*; import static java.lang.System.*; import static java.lang.System.*; public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(in);
        int N;
        N = scanner.nextInt();
        HashMap<String, Boolean> seen = new HashMap<>();
        String[] words = new String[N+1];
        for(int i = 0; i < N; ++i) {
            words[i] = scanner.next();
        }
        String ans = "Yes";
        for(int i = 1; i < N; ++i) {
            seen.put(words[i-1], true);
            if(words[i].charAt(0) != words[i-1].charAt(words[i-1].length()-1))
                ans = "No";
            if(seen.containsKey(words[i]))
                ans = "No";
        }
        System.out.println(ans);
    }
} Main public static void main(String[] args) {
        Scanner scanner = new Scanner(in);
        int N;
        N = scanner.nextInt();
        HashMap<String, Boolean> seen = new HashMap<>();
        String[] words = new String[N+1];
        for(int i = 0; i < N; ++i) {
            words[i] = scanner.next();
        }
        String ans = "Yes";
        for(int i = 1; i < N; ++i) {
            seen.put(words[i-1], true);
            if(words[i].charAt(0) != words[i-1].charAt(words[i-1].length()-1))
                ans = "No";
            if(seen.containsKey(words[i]))
                ans = "No";
        }
        System.out.println(ans);
    } main {
        Scanner scanner = new Scanner(in);
        int N;
        N = scanner.nextInt();
        HashMap<String, Boolean> seen = new HashMap<>();
        String[] words = new String[N+1];
        for(int i = 0; i < N; ++i) {
            words[i] = scanner.next();
        }
        String ans = "Yes";
        for(int i = 1; i < N; ++i) {
            seen.put(words[i-1], true);
            if(words[i].charAt(0) != words[i-1].charAt(words[i-1].length()-1))
                ans = "No";
            if(seen.containsKey(words[i]))
                ans = "No";
        }
        System.out.println(ans);
    } Scanner scanner = new Scanner(in); scanner new Scanner(in) int N; N N = scanner.nextInt() N scanner.nextInt() scanner.nextInt scanner HashMap<String, Boolean> seen = new HashMap<>(); seen new HashMap<>() String[] words = new String[N+1]; words new String[N+1] N+1 N 1 for(int i = 0; i < N; ++i) {
            words[i] = scanner.next();
        } int i = 0; int i = 0; i 0 i < N i N ++i ++i i {
            words[i] = scanner.next();
        } {
            words[i] = scanner.next();
        } words[i] = scanner.next() words[i] words i scanner.next() scanner.next scanner String ans = "Yes"; ans "Yes" for(int i = 1; i < N; ++i) {
            seen.put(words[i-1], true);
            if(words[i].charAt(0) != words[i-1].charAt(words[i-1].length()-1))
                ans = "No";
            if(seen.containsKey(words[i]))
                ans = "No";
        } int i = 1; int i = 1; i 1 i < N i N ++i ++i i {
            seen.put(words[i-1], true);
            if(words[i].charAt(0) != words[i-1].charAt(words[i-1].length()-1))
                ans = "No";
            if(seen.containsKey(words[i]))
                ans = "No";
        } {
            seen.put(words[i-1], true);
            if(words[i].charAt(0) != words[i-1].charAt(words[i-1].length()-1))
                ans = "No";
            if(seen.containsKey(words[i]))
                ans = "No";
        } seen.put(words[i-1], true) seen.put seen words[i-1] words i-1 i 1 true if(words[i].charAt(0) != words[i-1].charAt(words[i-1].length()-1))
                ans = "No"; words[i].charAt(0) != words[i-1].charAt(words[i-1].length()-1) words[i].charAt(0) words[i].charAt words[i] words i 0 words[i-1].charAt(words[i-1].length()-1) words[i-1].charAt words[i-1] words i-1 i 1 words[i-1].length()-1 words[i-1].length() words[i-1].length words[i-1] words i-1 i 1 1 ans = "No" ans "No" if(seen.containsKey(words[i]))
                ans = "No"; seen.containsKey(words[i]) seen.containsKey seen words[i] words i ans = "No" ans "No" System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(in);
        int N;
        N = scanner.nextInt();
        HashMap<String, Boolean> seen = new HashMap<>();
        String[] words = new String[N+1];
        for(int i = 0; i < N; ++i) {
            words[i] = scanner.next();
        }
        String ans = "Yes";
        for(int i = 1; i < N; ++i) {
            seen.put(words[i-1], true);
            if(words[i].charAt(0) != words[i-1].charAt(words[i-1].length()-1))
                ans = "No";
            if(seen.containsKey(words[i]))
                ans = "No";
        }
        System.out.println(ans);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(in);
        int N;
        N = scanner.nextInt();
        HashMap<String, Boolean> seen = new HashMap<>();
        String[] words = new String[N+1];
        for(int i = 0; i < N; ++i) {
            words[i] = scanner.next();
        }
        String ans = "Yes";
        for(int i = 1; i < N; ++i) {
            seen.put(words[i-1], true);
            if(words[i].charAt(0) != words[i-1].charAt(words[i-1].length()-1))
                ans = "No";
            if(seen.containsKey(words[i]))
                ans = "No";
        }
        System.out.println(ans);
    }
} Main
import java.util.*;
import static java.lang.System.*;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(in);
        int N;
        N = scanner.nextInt();
        HashMap<String, Boolean> seen = new HashMap<>();
        String[] words = new String[N+1];
        for(int i = 0; i < N; ++i) {
            words[i] = scanner.next();
        }
        String ans = "Yes";
        for(int i = 1; i < N; ++i) {
            seen.put(words[i-1], true);
            if(words[i].charAt(0) != words[i-1].charAt(words[i-1].length()-1))
                ans = "No";
            if(seen.containsKey(words[i]))
                ans = "No";
        }
        System.out.println(ans);
    }
}