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

public class Main {

  public static void main(String[] args) {
    Set<String> set = new HashSet<String>();
    Scanner scanner = new Scanner(System.in);
    char last = '\0';
    String result = "Yes";

    int N = scanner.nextInt();

    scanner.nextLine();
    for (int i = 0; i < N; i++) {
      String w = scanner.nextLine();

      if (set.contains(w)) {
        result = "No";
        break;
      }

      if (i > 0) {
        if (w.charAt(0) != last) {
          result = "No";
          break;
        }
      }
      set.add(w);
      last = w.charAt(w.length() - 1);
    }
    System.out.println(result);
  }

} 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) {
    Set<String> set = new HashSet<String>();
    Scanner scanner = new Scanner(System.in);
    char last = '\0';
    String result = "Yes";

    int N = scanner.nextInt();

    scanner.nextLine();
    for (int i = 0; i < N; i++) {
      String w = scanner.nextLine();

      if (set.contains(w)) {
        result = "No";
        break;
      }

      if (i > 0) {
        if (w.charAt(0) != last) {
          result = "No";
          break;
        }
      }
      set.add(w);
      last = w.charAt(w.length() - 1);
    }
    System.out.println(result);
  }

} Main public static void main(String[] args) {
    Set<String> set = new HashSet<String>();
    Scanner scanner = new Scanner(System.in);
    char last = '\0';
    String result = "Yes";

    int N = scanner.nextInt();

    scanner.nextLine();
    for (int i = 0; i < N; i++) {
      String w = scanner.nextLine();

      if (set.contains(w)) {
        result = "No";
        break;
      }

      if (i > 0) {
        if (w.charAt(0) != last) {
          result = "No";
          break;
        }
      }
      set.add(w);
      last = w.charAt(w.length() - 1);
    }
    System.out.println(result);
  } main {
    Set<String> set = new HashSet<String>();
    Scanner scanner = new Scanner(System.in);
    char last = '\0';
    String result = "Yes";

    int N = scanner.nextInt();

    scanner.nextLine();
    for (int i = 0; i < N; i++) {
      String w = scanner.nextLine();

      if (set.contains(w)) {
        result = "No";
        break;
      }

      if (i > 0) {
        if (w.charAt(0) != last) {
          result = "No";
          break;
        }
      }
      set.add(w);
      last = w.charAt(w.length() - 1);
    }
    System.out.println(result);
  } Set<String> set = new HashSet<String>(); set new HashSet<String>() Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) char last = '\0'; last '\0' String result = "Yes"; result "Yes" int N = scanner.nextInt(); N scanner.nextInt() scanner.nextInt scanner scanner.nextLine() scanner.nextLine scanner for (int i = 0; i < N; i++) {
      String w = scanner.nextLine();

      if (set.contains(w)) {
        result = "No";
        break;
      }

      if (i > 0) {
        if (w.charAt(0) != last) {
          result = "No";
          break;
        }
      }
      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 = scanner.nextLine();

      if (set.contains(w)) {
        result = "No";
        break;
      }

      if (i > 0) {
        if (w.charAt(0) != last) {
          result = "No";
          break;
        }
      }
      set.add(w);
      last = w.charAt(w.length() - 1);
    } {
      String w = scanner.nextLine();

      if (set.contains(w)) {
        result = "No";
        break;
      }

      if (i > 0) {
        if (w.charAt(0) != last) {
          result = "No";
          break;
        }
      }
      set.add(w);
      last = w.charAt(w.length() - 1);
    } String w = scanner.nextLine(); w scanner.nextLine() scanner.nextLine scanner if (set.contains(w)) {
        result = "No";
        break;
      } set.contains(w) set.contains set w {
        result = "No";
        break;
      } result = "No" result "No" break; if (i > 0) {
        if (w.charAt(0) != last) {
          result = "No";
          break;
        }
      } i > 0 i 0 {
        if (w.charAt(0) != last) {
          result = "No";
          break;
        }
      } if (w.charAt(0) != last) {
          result = "No";
          break;
        } w.charAt(0) != last w.charAt(0) w.charAt w 0 last {
          result = "No";
          break;
        } result = "No" result "No" break; 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(result) System.out.println System.out System System.out result String[] args args public class Main {

  public static void main(String[] args) {
    Set<String> set = new HashSet<String>();
    Scanner scanner = new Scanner(System.in);
    char last = '\0';
    String result = "Yes";

    int N = scanner.nextInt();

    scanner.nextLine();
    for (int i = 0; i < N; i++) {
      String w = scanner.nextLine();

      if (set.contains(w)) {
        result = "No";
        break;
      }

      if (i > 0) {
        if (w.charAt(0) != last) {
          result = "No";
          break;
        }
      }
      set.add(w);
      last = w.charAt(w.length() - 1);
    }
    System.out.println(result);
  }

} public class Main {

  public static void main(String[] args) {
    Set<String> set = new HashSet<String>();
    Scanner scanner = new Scanner(System.in);
    char last = '\0';
    String result = "Yes";

    int N = scanner.nextInt();

    scanner.nextLine();
    for (int i = 0; i < N; i++) {
      String w = scanner.nextLine();

      if (set.contains(w)) {
        result = "No";
        break;
      }

      if (i > 0) {
        if (w.charAt(0) != last) {
          result = "No";
          break;
        }
      }
      set.add(w);
      last = w.charAt(w.length() - 1);
    }
    System.out.println(result);
  }

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

public class Main {

  public static void main(String[] args) {
    Set<String> set = new HashSet<String>();
    Scanner scanner = new Scanner(System.in);
    char last = '\0';
    String result = "Yes";

    int N = scanner.nextInt();

    scanner.nextLine();
    for (int i = 0; i < N; i++) {
      String w = scanner.nextLine();

      if (set.contains(w)) {
        result = "No";
        break;
      }

      if (i > 0) {
        if (w.charAt(0) != last) {
          result = "No";
          break;
        }
      }
      set.add(w);
      last = w.charAt(w.length() - 1);
    }
    System.out.println(result);
  }

}
