import java.util.*;

public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    String[] s = new String[n];
    String str1 = null;
    String str2 = null;
    int x = 0;

    for(int i = 0;i < n;i++) {
      s[i] = sc.next();
    }

    for(int i = 0;i < n-1;i++) {

      for(int j = i+1;j < n;j++) {
        if(s[i].equals(s[j])) {
          x = 1;
          break;
        }
      }

      str1 = s[i].substring(s[i].length()-1,s[i].length());
      str2 = s[i+1].substring(0,1);

      if(str1.compareTo(str2) != 0) {
        x = 1;
      }

      if(x == 1) break;

    }

    if(x == 1) {
      System.out.println("No");
    } else {
      System.out.println("Yes");
    }
  }

} 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[] s = new String[n];
    String str1 = null;
    String str2 = null;
    int x = 0;

    for(int i = 0;i < n;i++) {
      s[i] = sc.next();
    }

    for(int i = 0;i < n-1;i++) {

      for(int j = i+1;j < n;j++) {
        if(s[i].equals(s[j])) {
          x = 1;
          break;
        }
      }

      str1 = s[i].substring(s[i].length()-1,s[i].length());
      str2 = s[i+1].substring(0,1);

      if(str1.compareTo(str2) != 0) {
        x = 1;
      }

      if(x == 1) break;

    }

    if(x == 1) {
      System.out.println("No");
    } else {
      System.out.println("Yes");
    }
  }

} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    String[] s = new String[n];
    String str1 = null;
    String str2 = null;
    int x = 0;

    for(int i = 0;i < n;i++) {
      s[i] = sc.next();
    }

    for(int i = 0;i < n-1;i++) {

      for(int j = i+1;j < n;j++) {
        if(s[i].equals(s[j])) {
          x = 1;
          break;
        }
      }

      str1 = s[i].substring(s[i].length()-1,s[i].length());
      str2 = s[i+1].substring(0,1);

      if(str1.compareTo(str2) != 0) {
        x = 1;
      }

      if(x == 1) break;

    }

    if(x == 1) {
      System.out.println("No");
    } else {
      System.out.println("Yes");
    }
  } main {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    String[] s = new String[n];
    String str1 = null;
    String str2 = null;
    int x = 0;

    for(int i = 0;i < n;i++) {
      s[i] = sc.next();
    }

    for(int i = 0;i < n-1;i++) {

      for(int j = i+1;j < n;j++) {
        if(s[i].equals(s[j])) {
          x = 1;
          break;
        }
      }

      str1 = s[i].substring(s[i].length()-1,s[i].length());
      str2 = s[i+1].substring(0,1);

      if(str1.compareTo(str2) != 0) {
        x = 1;
      }

      if(x == 1) break;

    }

    if(x == 1) {
      System.out.println("No");
    } else {
      System.out.println("Yes");
    }
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc String[] s = new String[n]; s new String[n] n String str1 = null; str1 null String str2 = null; str2 null int x = 0; x 0 for(int i = 0;i < n;i++) {
      s[i] = sc.next();
    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
      s[i] = sc.next();
    } {
      s[i] = sc.next();
    } s[i] = sc.next() s[i] s i sc.next() sc.next sc for(int i = 0;i < n-1;i++) {

      for(int j = i+1;j < n;j++) {
        if(s[i].equals(s[j])) {
          x = 1;
          break;
        }
      }

      str1 = s[i].substring(s[i].length()-1,s[i].length());
      str2 = s[i+1].substring(0,1);

      if(str1.compareTo(str2) != 0) {
        x = 1;
      }

      if(x == 1) break;

    } int i = 0; int i = 0; i 0 i < n-1 i n-1 n 1 i++ i++ i {

      for(int j = i+1;j < n;j++) {
        if(s[i].equals(s[j])) {
          x = 1;
          break;
        }
      }

      str1 = s[i].substring(s[i].length()-1,s[i].length());
      str2 = s[i+1].substring(0,1);

      if(str1.compareTo(str2) != 0) {
        x = 1;
      }

      if(x == 1) break;

    } {

      for(int j = i+1;j < n;j++) {
        if(s[i].equals(s[j])) {
          x = 1;
          break;
        }
      }

      str1 = s[i].substring(s[i].length()-1,s[i].length());
      str2 = s[i+1].substring(0,1);

      if(str1.compareTo(str2) != 0) {
        x = 1;
      }

      if(x == 1) break;

    } for(int j = i+1;j < n;j++) {
        if(s[i].equals(s[j])) {
          x = 1;
          break;
        }
      } int j = i+1; int j = i+1; j i+1 i 1 j < n j n j++ j++ j {
        if(s[i].equals(s[j])) {
          x = 1;
          break;
        }
      } {
        if(s[i].equals(s[j])) {
          x = 1;
          break;
        }
      } if(s[i].equals(s[j])) {
          x = 1;
          break;
        } s[i].equals(s[j]) s[i].equals s[i] s i s[j] s j {
          x = 1;
          break;
        } x = 1 x 1 break; str1 = s[i].substring(s[i].length()-1,s[i].length()) str1 s[i].substring(s[i].length()-1,s[i].length()) s[i].substring s[i] s i s[i].length()-1 s[i].length() s[i].length s[i] s i 1 s[i].length() s[i].length s[i] s i str2 = s[i+1].substring(0,1) str2 s[i+1].substring(0,1) s[i+1].substring s[i+1] s i+1 i 1 0 1 if(str1.compareTo(str2) != 0) {
        x = 1;
      } str1.compareTo(str2) != 0 str1.compareTo(str2) str1.compareTo str1 str2 0 {
        x = 1;
      } x = 1 x 1 if(x == 1) break; x == 1 x 1 break; if(x == 1) {
      System.out.println("No");
    } else {
      System.out.println("Yes");
    } x == 1 x 1 {
      System.out.println("No");
    } System.out.println("No") System.out.println System.out System System.out "No" {
      System.out.println("Yes");
    } 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 sc = new Scanner(System.in);
    int n = sc.nextInt();
    String[] s = new String[n];
    String str1 = null;
    String str2 = null;
    int x = 0;

    for(int i = 0;i < n;i++) {
      s[i] = sc.next();
    }

    for(int i = 0;i < n-1;i++) {

      for(int j = i+1;j < n;j++) {
        if(s[i].equals(s[j])) {
          x = 1;
          break;
        }
      }

      str1 = s[i].substring(s[i].length()-1,s[i].length());
      str2 = s[i+1].substring(0,1);

      if(str1.compareTo(str2) != 0) {
        x = 1;
      }

      if(x == 1) break;

    }

    if(x == 1) {
      System.out.println("No");
    } else {
      System.out.println("Yes");
    }
  }

} public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    String[] s = new String[n];
    String str1 = null;
    String str2 = null;
    int x = 0;

    for(int i = 0;i < n;i++) {
      s[i] = sc.next();
    }

    for(int i = 0;i < n-1;i++) {

      for(int j = i+1;j < n;j++) {
        if(s[i].equals(s[j])) {
          x = 1;
          break;
        }
      }

      str1 = s[i].substring(s[i].length()-1,s[i].length());
      str2 = s[i+1].substring(0,1);

      if(str1.compareTo(str2) != 0) {
        x = 1;
      }

      if(x == 1) break;

    }

    if(x == 1) {
      System.out.println("No");
    } else {
      System.out.println("Yes");
    }
  }

} Main
import java.util.*;

public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    String[] s = new String[n];
    String str1 = null;
    String str2 = null;
    int x = 0;

    for(int i = 0;i < n;i++) {
      s[i] = sc.next();
    }

    for(int i = 0;i < n-1;i++) {

      for(int j = i+1;j < n;j++) {
        if(s[i].equals(s[j])) {
          x = 1;
          break;
        }
      }

      str1 = s[i].substring(s[i].length()-1,s[i].length());
      str2 = s[i+1].substring(0,1);

      if(str1.compareTo(str2) != 0) {
        x = 1;
      }

      if(x == 1) break;

    }

    if(x == 1) {
      System.out.println("No");
    } else {
      System.out.println("Yes");
    }
  }

}
