import java.util.*;

public class Main {
  public static void main(String args[]) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    String A[] = new String[N];
    A[0] = sc.next();
    Boolean flag = true;
    
    for(int i=1; i<N; i++) {
      A[i] = sc.next();
      if(!A[i-1].substring(A[i-1].length()-1).equals(A[i].substring(0, 1))) {
        flag = false;
      }
    }
    Set<String> linkedHashSet = new LinkedHashSet<String>();

    // 配列の要素を順にLinkedHashSetオブジェクトへ追加
    for (int j = 0; j < A.length; j++) {
    linkedHashSet.add(A[j]);
    }

    // LinkedHashSetオブジェクトを配列に変換
    Object[] B = linkedHashSet.toArray();
    if(N!=B.length) {
      flag = false;
    }
    
    if(flag) {
      System.out.println("Yes");
    } else {
      System.out.println("No");
    }
  }
} import java.util.*; util.* java public class Main {
  public static void main(String args[]) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    String A[] = new String[N];
    A[0] = sc.next();
    Boolean flag = true;
    
    for(int i=1; i<N; i++) {
      A[i] = sc.next();
      if(!A[i-1].substring(A[i-1].length()-1).equals(A[i].substring(0, 1))) {
        flag = false;
      }
    }
    Set<String> linkedHashSet = new LinkedHashSet<String>();

    // 配列の要素を順にLinkedHashSetオブジェクトへ追加
    for (int j = 0; j < A.length; j++) {
    linkedHashSet.add(A[j]);
    }

    // LinkedHashSetオブジェクトを配列に変換
    Object[] B = linkedHashSet.toArray();
    if(N!=B.length) {
      flag = false;
    }
    
    if(flag) {
      System.out.println("Yes");
    } else {
      System.out.println("No");
    }
  }
} Main public static void main(String args[]) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    String A[] = new String[N];
    A[0] = sc.next();
    Boolean flag = true;
    
    for(int i=1; i<N; i++) {
      A[i] = sc.next();
      if(!A[i-1].substring(A[i-1].length()-1).equals(A[i].substring(0, 1))) {
        flag = false;
      }
    }
    Set<String> linkedHashSet = new LinkedHashSet<String>();

    // 配列の要素を順にLinkedHashSetオブジェクトへ追加
    for (int j = 0; j < A.length; j++) {
    linkedHashSet.add(A[j]);
    }

    // LinkedHashSetオブジェクトを配列に変換
    Object[] B = linkedHashSet.toArray();
    if(N!=B.length) {
      flag = false;
    }
    
    if(flag) {
      System.out.println("Yes");
    } else {
      System.out.println("No");
    }
  } main {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    String A[] = new String[N];
    A[0] = sc.next();
    Boolean flag = true;
    
    for(int i=1; i<N; i++) {
      A[i] = sc.next();
      if(!A[i-1].substring(A[i-1].length()-1).equals(A[i].substring(0, 1))) {
        flag = false;
      }
    }
    Set<String> linkedHashSet = new LinkedHashSet<String>();

    // 配列の要素を順にLinkedHashSetオブジェクトへ追加
    for (int j = 0; j < A.length; j++) {
    linkedHashSet.add(A[j]);
    }

    // LinkedHashSetオブジェクトを配列に変換
    Object[] B = linkedHashSet.toArray();
    if(N!=B.length) {
      flag = false;
    }
    
    if(flag) {
      System.out.println("Yes");
    } else {
      System.out.println("No");
    }
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc String A[] = new String[N]; A new String[N] N A[0] = sc.next() A[0] A 0 sc.next() sc.next sc Boolean flag = true; flag true for(int i=1; i<N; i++) {
      A[i] = sc.next();
      if(!A[i-1].substring(A[i-1].length()-1).equals(A[i].substring(0, 1))) {
        flag = false;
      }
    } int i=1; int i=1; i 1 i<N i N i++ i++ i {
      A[i] = sc.next();
      if(!A[i-1].substring(A[i-1].length()-1).equals(A[i].substring(0, 1))) {
        flag = false;
      }
    } {
      A[i] = sc.next();
      if(!A[i-1].substring(A[i-1].length()-1).equals(A[i].substring(0, 1))) {
        flag = false;
      }
    } A[i] = sc.next() A[i] A i sc.next() sc.next sc if(!A[i-1].substring(A[i-1].length()-1).equals(A[i].substring(0, 1))) {
        flag = false;
      } !A[i-1].substring(A[i-1].length()-1).equals(A[i].substring(0, 1)) A[i-1].substring(A[i-1].length()-1).equals(A[i].substring(0, 1)) A[i-1].substring(A[i-1].length()-1).equals A[i-1].substring(A[i-1].length()-1) A[i-1].substring A[i-1] A i-1 i 1 A[i-1].length()-1 A[i-1].length() A[i-1].length A[i-1] A i-1 i 1 1 A[i].substring(0, 1) A[i].substring A[i] A i 0 1 {
        flag = false;
      } flag = false flag false Set<String> linkedHashSet = new LinkedHashSet<String>(); linkedHashSet new LinkedHashSet<String>() for (int j = 0; j < A.length; j++) {
    linkedHashSet.add(A[j]);
    } int j = 0; int j = 0; j 0 j < A.length j A.length A A.length j++ j++ j {
    linkedHashSet.add(A[j]);
    } {
    linkedHashSet.add(A[j]);
    } linkedHashSet.add(A[j]) linkedHashSet.add linkedHashSet A[j] A j Object[] B = linkedHashSet.toArray(); B linkedHashSet.toArray() linkedHashSet.toArray linkedHashSet if(N!=B.length) {
      flag = false;
    } N!=B.length N B.length B B.length {
      flag = false;
    } flag = false flag false if(flag) {
      System.out.println("Yes");
    } else {
      System.out.println("No");
    } flag {
      System.out.println("Yes");
    } System.out.println("Yes") System.out.println System.out System System.out "Yes" {
      System.out.println("No");
    } System.out.println("No") System.out.println System.out System System.out "No" String args[] args public class Main {
  public static void main(String args[]) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    String A[] = new String[N];
    A[0] = sc.next();
    Boolean flag = true;
    
    for(int i=1; i<N; i++) {
      A[i] = sc.next();
      if(!A[i-1].substring(A[i-1].length()-1).equals(A[i].substring(0, 1))) {
        flag = false;
      }
    }
    Set<String> linkedHashSet = new LinkedHashSet<String>();

    // 配列の要素を順にLinkedHashSetオブジェクトへ追加
    for (int j = 0; j < A.length; j++) {
    linkedHashSet.add(A[j]);
    }

    // LinkedHashSetオブジェクトを配列に変換
    Object[] B = linkedHashSet.toArray();
    if(N!=B.length) {
      flag = false;
    }
    
    if(flag) {
      System.out.println("Yes");
    } else {
      System.out.println("No");
    }
  }
} public class Main {
  public static void main(String args[]) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    String A[] = new String[N];
    A[0] = sc.next();
    Boolean flag = true;
    
    for(int i=1; i<N; i++) {
      A[i] = sc.next();
      if(!A[i-1].substring(A[i-1].length()-1).equals(A[i].substring(0, 1))) {
        flag = false;
      }
    }
    Set<String> linkedHashSet = new LinkedHashSet<String>();

    // 配列の要素を順にLinkedHashSetオブジェクトへ追加
    for (int j = 0; j < A.length; j++) {
    linkedHashSet.add(A[j]);
    }

    // LinkedHashSetオブジェクトを配列に変換
    Object[] B = linkedHashSet.toArray();
    if(N!=B.length) {
      flag = false;
    }
    
    if(flag) {
      System.out.println("Yes");
    } else {
      System.out.println("No");
    }
  }
} Main
import java.util.*;

public class Main {
  public static void main(String args[]) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    String A[] = new String[N];
    A[0] = sc.next();
    Boolean flag = true;
    
    for(int i=1; i<N; i++) {
      A[i] = sc.next();
      if(!A[i-1].substring(A[i-1].length()-1).equals(A[i].substring(0, 1))) {
        flag = false;
      }
    }
    Set<String> linkedHashSet = new LinkedHashSet<String>();

    // 配列の要素を順にLinkedHashSetオブジェクトへ追加
    for (int j = 0; j < A.length; j++) {
    linkedHashSet.add(A[j]);
    }

    // LinkedHashSetオブジェクトを配列に変換
    Object[] B = linkedHashSet.toArray();
    if(N!=B.length) {
      flag = false;
    }
    
    if(flag) {
      System.out.println("Yes");
    } else {
      System.out.println("No");
    }
  }
}