import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);

    int N = scanner.nextInt();
    String[] words = new String[N];
    for (int i = 0; i < N; i++) words[i] = scanner.next();
    Set<String> set = new HashSet<>();
    char last = words[0].charAt(0);
    for (int i = 0; i < N; i++) {
      String w = words[i];
      if (set.contains(w) || last != w.charAt(0)) {
        System.out.println("No");
        return;
      }
      set.add(w);
      last = w.charAt(w.length() - 1);
    }
    System.out.println("Yes");
  }
} 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 scanner = new Scanner(System.in);

    int N = scanner.nextInt();
    String[] words = new String[N];
    for (int i = 0; i < N; i++) words[i] = scanner.next();
    Set<String> set = new HashSet<>();
    char last = words[0].charAt(0);
    for (int i = 0; i < N; i++) {
      String w = words[i];
      if (set.contains(w) || last != w.charAt(0)) {
        System.out.println("No");
        return;
      }
      set.add(w);
      last = w.charAt(w.length() - 1);
    }
    System.out.println("Yes");
  }
} Main public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);

    int N = scanner.nextInt();
    String[] words = new String[N];
    for (int i = 0; i < N; i++) words[i] = scanner.next();
    Set<String> set = new HashSet<>();
    char last = words[0].charAt(0);
    for (int i = 0; i < N; i++) {
      String w = words[i];
      if (set.contains(w) || last != w.charAt(0)) {
        System.out.println("No");
        return;
      }
      set.add(w);
      last = w.charAt(w.length() - 1);
    }
    System.out.println("Yes");
  } main {
    Scanner scanner = new Scanner(System.in);

    int N = scanner.nextInt();
    String[] words = new String[N];
    for (int i = 0; i < N; i++) words[i] = scanner.next();
    Set<String> set = new HashSet<>();
    char last = words[0].charAt(0);
    for (int i = 0; i < N; i++) {
      String w = words[i];
      if (set.contains(w) || last != w.charAt(0)) {
        System.out.println("No");
        return;
      }
      set.add(w);
      last = w.charAt(w.length() - 1);
    }
    System.out.println("Yes");
  } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int N = scanner.nextInt(); N scanner.nextInt() scanner.nextInt scanner String[] words = new String[N]; words new String[N] N 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] words i scanner.next() scanner.next scanner Set<String> set = new HashSet<>(); set new HashSet<>() char last = words[0].charAt(0); last words[0].charAt(0) words[0].charAt words[0] words 0 0 for (int i = 0; i < N; i++) {
      String w = words[i];
      if (set.contains(w) || last != w.charAt(0)) {
        System.out.println("No");
        return;
      }
      set.add(w);
      last = w.charAt(w.length() - 1);
    } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
      String w = words[i];
      if (set.contains(w) || last != w.charAt(0)) {
        System.out.println("No");
        return;
      }
      set.add(w);
      last = w.charAt(w.length() - 1);
    } {
      String w = words[i];
      if (set.contains(w) || last != w.charAt(0)) {
        System.out.println("No");
        return;
      }
      set.add(w);
      last = w.charAt(w.length() - 1);
    } String w = words[i]; w words[i] words i if (set.contains(w) || last != w.charAt(0)) {
        System.out.println("No");
        return;
      } set.contains(w) || last != w.charAt(0) set.contains(w) set.contains set w last != w.charAt(0) last w.charAt(0) w.charAt w 0 {
        System.out.println("No");
        return;
      } System.out.println("No") System.out.println System.out System System.out "No" return; set.add(w) set.add set w last = w.charAt(w.length() - 1) last w.charAt(w.length() - 1) w.charAt w w.length() - 1 w.length() w.length w 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) {
    Scanner scanner = new Scanner(System.in);

    int N = scanner.nextInt();
    String[] words = new String[N];
    for (int i = 0; i < N; i++) words[i] = scanner.next();
    Set<String> set = new HashSet<>();
    char last = words[0].charAt(0);
    for (int i = 0; i < N; i++) {
      String w = words[i];
      if (set.contains(w) || last != w.charAt(0)) {
        System.out.println("No");
        return;
      }
      set.add(w);
      last = w.charAt(w.length() - 1);
    }
    System.out.println("Yes");
  }
} public class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);

    int N = scanner.nextInt();
    String[] words = new String[N];
    for (int i = 0; i < N; i++) words[i] = scanner.next();
    Set<String> set = new HashSet<>();
    char last = words[0].charAt(0);
    for (int i = 0; i < N; i++) {
      String w = words[i];
      if (set.contains(w) || last != w.charAt(0)) {
        System.out.println("No");
        return;
      }
      set.add(w);
      last = w.charAt(w.length() - 1);
    }
    System.out.println("Yes");
  }
} Main
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);

    int N = scanner.nextInt();
    String[] words = new String[N];
    for (int i = 0; i < N; i++) words[i] = scanner.next();
    Set<String> set = new HashSet<>();
    char last = words[0].charAt(0);
    for (int i = 0; i < N; i++) {
      String w = words[i];
      if (set.contains(w) || last != w.charAt(0)) {
        System.out.println("No");
        return;
      }
      set.add(w);
      last = w.charAt(w.length() - 1);
    }
    System.out.println("Yes");
  }
}
