import java.util.*;
import java.util.Collections;
import java.util.stream.Collectors;

public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    List<String> list = new ArrayList<String>();
    String ans = "Yes";
    for (int i = 0; i < N; i++) {
      list.add(sc.next());
    }
    List<String> list2 = list.stream().distinct().collect(Collectors.toList());
    if (list2.size() != N) {
      ans = "No";
    } else {
      for (int i = 1; i < N; i++) {
        String formar = list.get(i - 1);
        String latter = list.get(i);
        if (formar.charAt(formar.length() - 1) != latter.charAt(0)) {
          ans = "No";
          break;
        }
      }
    }
    System.out.println(ans);
  }
} import java.util.*; util.* java import java.util.Collections; Collections java.util import java.util.stream.Collectors; Collectors java.util.stream public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    List<String> list = new ArrayList<String>();
    String ans = "Yes";
    for (int i = 0; i < N; i++) {
      list.add(sc.next());
    }
    List<String> list2 = list.stream().distinct().collect(Collectors.toList());
    if (list2.size() != N) {
      ans = "No";
    } else {
      for (int i = 1; i < N; i++) {
        String formar = list.get(i - 1);
        String latter = list.get(i);
        if (formar.charAt(formar.length() - 1) != latter.charAt(0)) {
          ans = "No";
          break;
        }
      }
    }
    System.out.println(ans);
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    List<String> list = new ArrayList<String>();
    String ans = "Yes";
    for (int i = 0; i < N; i++) {
      list.add(sc.next());
    }
    List<String> list2 = list.stream().distinct().collect(Collectors.toList());
    if (list2.size() != N) {
      ans = "No";
    } else {
      for (int i = 1; i < N; i++) {
        String formar = list.get(i - 1);
        String latter = list.get(i);
        if (formar.charAt(formar.length() - 1) != latter.charAt(0)) {
          ans = "No";
          break;
        }
      }
    }
    System.out.println(ans);
  } main {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    List<String> list = new ArrayList<String>();
    String ans = "Yes";
    for (int i = 0; i < N; i++) {
      list.add(sc.next());
    }
    List<String> list2 = list.stream().distinct().collect(Collectors.toList());
    if (list2.size() != N) {
      ans = "No";
    } else {
      for (int i = 1; i < N; i++) {
        String formar = list.get(i - 1);
        String latter = list.get(i);
        if (formar.charAt(formar.length() - 1) != latter.charAt(0)) {
          ans = "No";
          break;
        }
      }
    }
    System.out.println(ans);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc List<String> list = new ArrayList<String>(); list new ArrayList<String>() String ans = "Yes"; ans "Yes" for (int i = 0; i < N; i++) {
      list.add(sc.next());
    } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
      list.add(sc.next());
    } {
      list.add(sc.next());
    } list.add(sc.next()) list.add list sc.next() sc.next sc List<String> list2 = list.stream().distinct().collect(Collectors.toList()); list2 list.stream().distinct().collect(Collectors.toList()) list.stream().distinct().collect list.stream().distinct() list.stream().distinct list.stream() list.stream list Collectors.toList() Collectors.toList Collectors if (list2.size() != N) {
      ans = "No";
    } else {
      for (int i = 1; i < N; i++) {
        String formar = list.get(i - 1);
        String latter = list.get(i);
        if (formar.charAt(formar.length() - 1) != latter.charAt(0)) {
          ans = "No";
          break;
        }
      }
    } list2.size() != N list2.size() list2.size list2 N {
      ans = "No";
    } ans = "No" ans "No" {
      for (int i = 1; i < N; i++) {
        String formar = list.get(i - 1);
        String latter = list.get(i);
        if (formar.charAt(formar.length() - 1) != latter.charAt(0)) {
          ans = "No";
          break;
        }
      }
    } for (int i = 1; i < N; i++) {
        String formar = list.get(i - 1);
        String latter = list.get(i);
        if (formar.charAt(formar.length() - 1) != latter.charAt(0)) {
          ans = "No";
          break;
        }
      } int i = 1; int i = 1; i 1 i < N i N i++ i++ i {
        String formar = list.get(i - 1);
        String latter = list.get(i);
        if (formar.charAt(formar.length() - 1) != latter.charAt(0)) {
          ans = "No";
          break;
        }
      } {
        String formar = list.get(i - 1);
        String latter = list.get(i);
        if (formar.charAt(formar.length() - 1) != latter.charAt(0)) {
          ans = "No";
          break;
        }
      } String formar = list.get(i - 1); formar list.get(i - 1) list.get list i - 1 i 1 String latter = list.get(i); latter list.get(i) list.get list i if (formar.charAt(formar.length() - 1) != latter.charAt(0)) {
          ans = "No";
          break;
        } formar.charAt(formar.length() - 1) != latter.charAt(0) formar.charAt(formar.length() - 1) formar.charAt formar formar.length() - 1 formar.length() formar.length formar 1 latter.charAt(0) latter.charAt latter 0 {
          ans = "No";
          break;
        } ans = "No" ans "No" break; 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 sc = new Scanner(System.in);
    int N = sc.nextInt();
    List<String> list = new ArrayList<String>();
    String ans = "Yes";
    for (int i = 0; i < N; i++) {
      list.add(sc.next());
    }
    List<String> list2 = list.stream().distinct().collect(Collectors.toList());
    if (list2.size() != N) {
      ans = "No";
    } else {
      for (int i = 1; i < N; i++) {
        String formar = list.get(i - 1);
        String latter = list.get(i);
        if (formar.charAt(formar.length() - 1) != latter.charAt(0)) {
          ans = "No";
          break;
        }
      }
    }
    System.out.println(ans);
  }
} public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    List<String> list = new ArrayList<String>();
    String ans = "Yes";
    for (int i = 0; i < N; i++) {
      list.add(sc.next());
    }
    List<String> list2 = list.stream().distinct().collect(Collectors.toList());
    if (list2.size() != N) {
      ans = "No";
    } else {
      for (int i = 1; i < N; i++) {
        String formar = list.get(i - 1);
        String latter = list.get(i);
        if (formar.charAt(formar.length() - 1) != latter.charAt(0)) {
          ans = "No";
          break;
        }
      }
    }
    System.out.println(ans);
  }
} Main
import java.util.*;
import java.util.Collections;
import java.util.stream.Collectors;

public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    List<String> list = new ArrayList<String>();
    String ans = "Yes";
    for (int i = 0; i < N; i++) {
      list.add(sc.next());
    }
    List<String> list2 = list.stream().distinct().collect(Collectors.toList());
    if (list2.size() != N) {
      ans = "No";
    } else {
      for (int i = 1; i < N; i++) {
        String formar = list.get(i - 1);
        String latter = list.get(i);
        if (formar.charAt(formar.length() - 1) != latter.charAt(0)) {
          ans = "No";
          break;
        }
      }
    }
    System.out.println(ans);
  }
}
