import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
  int n = sc.nextInt();
  HashSet<String> hs = new HashSet<String>();
  boolean ok = true;
  String a = sc.next();
  String b = "";
  hs.add(a);
  for(int i = 0;i < n-1;i++){
    b = sc.next();
    if(hs.contains(b)){
      ok = false;
      break;
    }
    char[] ac = a.toCharArray();
    char[] bc = b.toCharArray();
    if(ac[ac.length - 1] != bc[0]){
      ok = false;
      break;
    }
    hs.add(b);
    a = b;
  }
  System.out.println(ok? "Yes":"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();
  HashSet<String> hs = new HashSet<String>();
  boolean ok = true;
  String a = sc.next();
  String b = "";
  hs.add(a);
  for(int i = 0;i < n-1;i++){
    b = sc.next();
    if(hs.contains(b)){
      ok = false;
      break;
    }
    char[] ac = a.toCharArray();
    char[] bc = b.toCharArray();
    if(ac[ac.length - 1] != bc[0]){
      ok = false;
      break;
    }
    hs.add(b);
    a = b;
  }
  System.out.println(ok? "Yes":"No");
}} Main public static void main(String[] args){
Scanner sc = new Scanner(System.in);
  int n = sc.nextInt();
  HashSet<String> hs = new HashSet<String>();
  boolean ok = true;
  String a = sc.next();
  String b = "";
  hs.add(a);
  for(int i = 0;i < n-1;i++){
    b = sc.next();
    if(hs.contains(b)){
      ok = false;
      break;
    }
    char[] ac = a.toCharArray();
    char[] bc = b.toCharArray();
    if(ac[ac.length - 1] != bc[0]){
      ok = false;
      break;
    }
    hs.add(b);
    a = b;
  }
  System.out.println(ok? "Yes":"No");
} main {
Scanner sc = new Scanner(System.in);
  int n = sc.nextInt();
  HashSet<String> hs = new HashSet<String>();
  boolean ok = true;
  String a = sc.next();
  String b = "";
  hs.add(a);
  for(int i = 0;i < n-1;i++){
    b = sc.next();
    if(hs.contains(b)){
      ok = false;
      break;
    }
    char[] ac = a.toCharArray();
    char[] bc = b.toCharArray();
    if(ac[ac.length - 1] != bc[0]){
      ok = false;
      break;
    }
    hs.add(b);
    a = b;
  }
  System.out.println(ok? "Yes":"No");
} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc HashSet<String> hs = new HashSet<String>(); hs new HashSet<String>() boolean ok = true; ok true String a = sc.next(); a sc.next() sc.next sc String b = ""; b "" hs.add(a) hs.add hs a for(int i = 0;i < n-1;i++){
    b = sc.next();
    if(hs.contains(b)){
      ok = false;
      break;
    }
    char[] ac = a.toCharArray();
    char[] bc = b.toCharArray();
    if(ac[ac.length - 1] != bc[0]){
      ok = false;
      break;
    }
    hs.add(b);
    a = b;
  } int i = 0; int i = 0; i 0 i < n-1 i n-1 n 1 i++ i++ i {
    b = sc.next();
    if(hs.contains(b)){
      ok = false;
      break;
    }
    char[] ac = a.toCharArray();
    char[] bc = b.toCharArray();
    if(ac[ac.length - 1] != bc[0]){
      ok = false;
      break;
    }
    hs.add(b);
    a = b;
  } {
    b = sc.next();
    if(hs.contains(b)){
      ok = false;
      break;
    }
    char[] ac = a.toCharArray();
    char[] bc = b.toCharArray();
    if(ac[ac.length - 1] != bc[0]){
      ok = false;
      break;
    }
    hs.add(b);
    a = b;
  } b = sc.next() b sc.next() sc.next sc if(hs.contains(b)){
      ok = false;
      break;
    } hs.contains(b) hs.contains hs b {
      ok = false;
      break;
    } ok = false ok false break; char[] ac = a.toCharArray(); ac a.toCharArray() a.toCharArray a char[] bc = b.toCharArray(); bc b.toCharArray() b.toCharArray b if(ac[ac.length - 1] != bc[0]){
      ok = false;
      break;
    } ac[ac.length - 1] != bc[0] ac[ac.length - 1] ac ac.length - 1 ac.length ac ac.length 1 bc[0] bc 0 {
      ok = false;
      break;
    } ok = false ok false break; hs.add(b) hs.add hs b a = b a b System.out.println(ok? "Yes":"No") System.out.println System.out System System.out ok? "Yes":"No" ok "Yes" "No" String[] args args public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
  int n = sc.nextInt();
  HashSet<String> hs = new HashSet<String>();
  boolean ok = true;
  String a = sc.next();
  String b = "";
  hs.add(a);
  for(int i = 0;i < n-1;i++){
    b = sc.next();
    if(hs.contains(b)){
      ok = false;
      break;
    }
    char[] ac = a.toCharArray();
    char[] bc = b.toCharArray();
    if(ac[ac.length - 1] != bc[0]){
      ok = false;
      break;
    }
    hs.add(b);
    a = b;
  }
  System.out.println(ok? "Yes":"No");
}} public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
  int n = sc.nextInt();
  HashSet<String> hs = new HashSet<String>();
  boolean ok = true;
  String a = sc.next();
  String b = "";
  hs.add(a);
  for(int i = 0;i < n-1;i++){
    b = sc.next();
    if(hs.contains(b)){
      ok = false;
      break;
    }
    char[] ac = a.toCharArray();
    char[] bc = b.toCharArray();
    if(ac[ac.length - 1] != bc[0]){
      ok = false;
      break;
    }
    hs.add(b);
    a = b;
  }
  System.out.println(ok? "Yes":"No");
}} Main
import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
  int n = sc.nextInt();
  HashSet<String> hs = new HashSet<String>();
  boolean ok = true;
  String a = sc.next();
  String b = "";
  hs.add(a);
  for(int i = 0;i < n-1;i++){
    b = sc.next();
    if(hs.contains(b)){
      ok = false;
      break;
    }
    char[] ac = a.toCharArray();
    char[] bc = b.toCharArray();
    if(ac[ac.length - 1] != bc[0]){
      ok = false;
      break;
    }
    hs.add(b);
    a = b;
  }
  System.out.println(ok? "Yes":"No");
}}