import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashSet;
import java.util.Set;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(input.readLine());
        Set<String> set = new HashSet<>();
        String value = input.readLine();
        char lastChar = value.charAt(value.length() - 1);
        set.add(value);
        for (int i = 1; i < n; i++) {
            value = input.readLine();
            if (set.contains(value) || lastChar != value.charAt(0)) {
                System.out.println("No");
                return;
            }
            set.add(value);
            lastChar = value.charAt(value.length() - 1);
        }
        System.out.println("Yes");
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.HashSet; HashSet java.util import java.util.Set; Set java.util public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(input.readLine());
        Set<String> set = new HashSet<>();
        String value = input.readLine();
        char lastChar = value.charAt(value.length() - 1);
        set.add(value);
        for (int i = 1; i < n; i++) {
            value = input.readLine();
            if (set.contains(value) || lastChar != value.charAt(0)) {
                System.out.println("No");
                return;
            }
            set.add(value);
            lastChar = value.charAt(value.length() - 1);
        }
        System.out.println("Yes");
    }
} Main public static void main(String[] args) throws IOException {
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(input.readLine());
        Set<String> set = new HashSet<>();
        String value = input.readLine();
        char lastChar = value.charAt(value.length() - 1);
        set.add(value);
        for (int i = 1; i < n; i++) {
            value = input.readLine();
            if (set.contains(value) || lastChar != value.charAt(0)) {
                System.out.println("No");
                return;
            }
            set.add(value);
            lastChar = value.charAt(value.length() - 1);
        }
        System.out.println("Yes");
    } main {
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(input.readLine());
        Set<String> set = new HashSet<>();
        String value = input.readLine();
        char lastChar = value.charAt(value.length() - 1);
        set.add(value);
        for (int i = 1; i < n; i++) {
            value = input.readLine();
            if (set.contains(value) || lastChar != value.charAt(0)) {
                System.out.println("No");
                return;
            }
            set.add(value);
            lastChar = value.charAt(value.length() - 1);
        }
        System.out.println("Yes");
    } BufferedReader input = new BufferedReader(new InputStreamReader(System.in)); input new BufferedReader(new InputStreamReader(System.in)) int n = Integer.parseInt(input.readLine()); n Integer.parseInt(input.readLine()) Integer.parseInt Integer input.readLine() input.readLine input Set<String> set = new HashSet<>(); set new HashSet<>() String value = input.readLine(); value input.readLine() input.readLine input char lastChar = value.charAt(value.length() - 1); lastChar value.charAt(value.length() - 1) value.charAt value value.length() - 1 value.length() value.length value 1 set.add(value) set.add set value for (int i = 1; i < n; i++) {
            value = input.readLine();
            if (set.contains(value) || lastChar != value.charAt(0)) {
                System.out.println("No");
                return;
            }
            set.add(value);
            lastChar = value.charAt(value.length() - 1);
        } int i = 1; int i = 1; i 1 i < n i n i++ i++ i {
            value = input.readLine();
            if (set.contains(value) || lastChar != value.charAt(0)) {
                System.out.println("No");
                return;
            }
            set.add(value);
            lastChar = value.charAt(value.length() - 1);
        } {
            value = input.readLine();
            if (set.contains(value) || lastChar != value.charAt(0)) {
                System.out.println("No");
                return;
            }
            set.add(value);
            lastChar = value.charAt(value.length() - 1);
        } value = input.readLine() value input.readLine() input.readLine input if (set.contains(value) || lastChar != value.charAt(0)) {
                System.out.println("No");
                return;
            } set.contains(value) || lastChar != value.charAt(0) set.contains(value) set.contains set value lastChar != value.charAt(0) lastChar value.charAt(0) value.charAt value 0 {
                System.out.println("No");
                return;
            } System.out.println("No") System.out.println System.out System System.out "No" return; set.add(value) set.add set value lastChar = value.charAt(value.length() - 1) lastChar value.charAt(value.length() - 1) value.charAt value value.length() - 1 value.length() value.length value 1 System.out.println("Yes") System.out.println System.out System System.out "Yes" String[] args args public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(input.readLine());
        Set<String> set = new HashSet<>();
        String value = input.readLine();
        char lastChar = value.charAt(value.length() - 1);
        set.add(value);
        for (int i = 1; i < n; i++) {
            value = input.readLine();
            if (set.contains(value) || lastChar != value.charAt(0)) {
                System.out.println("No");
                return;
            }
            set.add(value);
            lastChar = value.charAt(value.length() - 1);
        }
        System.out.println("Yes");
    }
} public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(input.readLine());
        Set<String> set = new HashSet<>();
        String value = input.readLine();
        char lastChar = value.charAt(value.length() - 1);
        set.add(value);
        for (int i = 1; i < n; i++) {
            value = input.readLine();
            if (set.contains(value) || lastChar != value.charAt(0)) {
                System.out.println("No");
                return;
            }
            set.add(value);
            lastChar = value.charAt(value.length() - 1);
        }
        System.out.println("Yes");
    }
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashSet;
import java.util.Set;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(input.readLine());
        Set<String> set = new HashSet<>();
        String value = input.readLine();
        char lastChar = value.charAt(value.length() - 1);
        set.add(value);
        for (int i = 1; i < n; i++) {
            value = input.readLine();
            if (set.contains(value) || lastChar != value.charAt(0)) {
                System.out.println("No");
                return;
            }
            set.add(value);
            lastChar = value.charAt(value.length() - 1);
        }
        System.out.println("Yes");
    }
}
