import java.util.*;
public class Main {

  public static void main(String[] args) { 
      Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();
      Set<String> said = new HashSet<>();
      
      char prevChar = '0';
      for(int i = 0; i < n; i++) {
        String word = sc.next();
        if(said.contains(word) || i > 0 && prevChar != word.charAt(0)) {
          System.out.println("No");
          return;
        }
        said.add(word);
        prevChar = word.charAt(word.length() - 1);
      }
      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();
      Set<String> said = new HashSet<>();
      
      char prevChar = '0';
      for(int i = 0; i < n; i++) {
        String word = sc.next();
        if(said.contains(word) || i > 0 && prevChar != word.charAt(0)) {
          System.out.println("No");
          return;
        }
        said.add(word);
        prevChar = word.charAt(word.length() - 1);
      }
      System.out.println("Yes");
  }
} Main public static void main(String[] args) { 
      Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();
      Set<String> said = new HashSet<>();
      
      char prevChar = '0';
      for(int i = 0; i < n; i++) {
        String word = sc.next();
        if(said.contains(word) || i > 0 && prevChar != word.charAt(0)) {
          System.out.println("No");
          return;
        }
        said.add(word);
        prevChar = word.charAt(word.length() - 1);
      }
      System.out.println("Yes");
  } main { 
      Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();
      Set<String> said = new HashSet<>();
      
      char prevChar = '0';
      for(int i = 0; i < n; i++) {
        String word = sc.next();
        if(said.contains(word) || i > 0 && prevChar != word.charAt(0)) {
          System.out.println("No");
          return;
        }
        said.add(word);
        prevChar = word.charAt(word.length() - 1);
      }
      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 Set<String> said = new HashSet<>(); said new HashSet<>() char prevChar = '0'; prevChar '0' for(int i = 0; i < n; i++) {
        String word = sc.next();
        if(said.contains(word) || i > 0 && prevChar != word.charAt(0)) {
          System.out.println("No");
          return;
        }
        said.add(word);
        prevChar = word.charAt(word.length() - 1);
      } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
        String word = sc.next();
        if(said.contains(word) || i > 0 && prevChar != word.charAt(0)) {
          System.out.println("No");
          return;
        }
        said.add(word);
        prevChar = word.charAt(word.length() - 1);
      } {
        String word = sc.next();
        if(said.contains(word) || i > 0 && prevChar != word.charAt(0)) {
          System.out.println("No");
          return;
        }
        said.add(word);
        prevChar = word.charAt(word.length() - 1);
      } String word = sc.next(); word sc.next() sc.next sc if(said.contains(word) || i > 0 && prevChar != word.charAt(0)) {
          System.out.println("No");
          return;
        } said.contains(word) || i > 0 && prevChar != word.charAt(0) said.contains(word) said.contains said word i > 0 && prevChar != word.charAt(0) i > 0 i 0 prevChar != word.charAt(0) prevChar word.charAt(0) word.charAt word 0 {
          System.out.println("No");
          return;
        } System.out.println("No") System.out.println System.out System System.out "No" return; said.add(word) said.add said word prevChar = word.charAt(word.length() - 1) prevChar word.charAt(word.length() - 1) word.charAt word word.length() - 1 word.length() word.length word 1 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();
      Set<String> said = new HashSet<>();
      
      char prevChar = '0';
      for(int i = 0; i < n; i++) {
        String word = sc.next();
        if(said.contains(word) || i > 0 && prevChar != word.charAt(0)) {
          System.out.println("No");
          return;
        }
        said.add(word);
        prevChar = word.charAt(word.length() - 1);
      }
      System.out.println("Yes");
  }
} public class Main {

  public static void main(String[] args) { 
      Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();
      Set<String> said = new HashSet<>();
      
      char prevChar = '0';
      for(int i = 0; i < n; i++) {
        String word = sc.next();
        if(said.contains(word) || i > 0 && prevChar != word.charAt(0)) {
          System.out.println("No");
          return;
        }
        said.add(word);
        prevChar = word.charAt(word.length() - 1);
      }
      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();
      Set<String> said = new HashSet<>();
      
      char prevChar = '0';
      for(int i = 0; i < n; i++) {
        String word = sc.next();
        if(said.contains(word) || i > 0 && prevChar != word.charAt(0)) {
          System.out.println("No");
          return;
        }
        said.add(word);
        prevChar = word.charAt(word.length() - 1);
      }
      System.out.println("Yes");
  }
}