import java.util.HashSet;
import java.util.Scanner;

public class Main {
  public static void main (String[] args) {
    Scanner in = new Scanner(System.in);

    while (in.hasNext()) {
      HashSet<String> said = new HashSet<String>();
      int N = in.nextInt();
      String prev = in.next();
      boolean isShiritoriRule = true;

      --N;
      said.add(prev);
      while (N-- > 0){
        String curr = in.next();

        if (said.contains(curr)) {
          isShiritoriRule = false;
        }

        if (prev.charAt(prev.length() - 1) != curr.charAt(0)) {
          isShiritoriRule = false;
        }
        
        said.add(curr);
        prev = curr;
      }

      if (isShiritoriRule) {
        System.out.println("Yes");
      } else {
        System.out.println("No");
      }
    }
  }
} import java.util.HashSet; HashSet java.util import java.util.Scanner; Scanner java.util public class Main {
  public static void main (String[] args) {
    Scanner in = new Scanner(System.in);

    while (in.hasNext()) {
      HashSet<String> said = new HashSet<String>();
      int N = in.nextInt();
      String prev = in.next();
      boolean isShiritoriRule = true;

      --N;
      said.add(prev);
      while (N-- > 0){
        String curr = in.next();

        if (said.contains(curr)) {
          isShiritoriRule = false;
        }

        if (prev.charAt(prev.length() - 1) != curr.charAt(0)) {
          isShiritoriRule = false;
        }
        
        said.add(curr);
        prev = curr;
      }

      if (isShiritoriRule) {
        System.out.println("Yes");
      } else {
        System.out.println("No");
      }
    }
  }
} Main public static void main (String[] args) {
    Scanner in = new Scanner(System.in);

    while (in.hasNext()) {
      HashSet<String> said = new HashSet<String>();
      int N = in.nextInt();
      String prev = in.next();
      boolean isShiritoriRule = true;

      --N;
      said.add(prev);
      while (N-- > 0){
        String curr = in.next();

        if (said.contains(curr)) {
          isShiritoriRule = false;
        }

        if (prev.charAt(prev.length() - 1) != curr.charAt(0)) {
          isShiritoriRule = false;
        }
        
        said.add(curr);
        prev = curr;
      }

      if (isShiritoriRule) {
        System.out.println("Yes");
      } else {
        System.out.println("No");
      }
    }
  } main {
    Scanner in = new Scanner(System.in);

    while (in.hasNext()) {
      HashSet<String> said = new HashSet<String>();
      int N = in.nextInt();
      String prev = in.next();
      boolean isShiritoriRule = true;

      --N;
      said.add(prev);
      while (N-- > 0){
        String curr = in.next();

        if (said.contains(curr)) {
          isShiritoriRule = false;
        }

        if (prev.charAt(prev.length() - 1) != curr.charAt(0)) {
          isShiritoriRule = false;
        }
        
        said.add(curr);
        prev = curr;
      }

      if (isShiritoriRule) {
        System.out.println("Yes");
      } else {
        System.out.println("No");
      }
    }
  } Scanner in = new Scanner(System.in); in new Scanner(System.in) while (in.hasNext()) {
      HashSet<String> said = new HashSet<String>();
      int N = in.nextInt();
      String prev = in.next();
      boolean isShiritoriRule = true;

      --N;
      said.add(prev);
      while (N-- > 0){
        String curr = in.next();

        if (said.contains(curr)) {
          isShiritoriRule = false;
        }

        if (prev.charAt(prev.length() - 1) != curr.charAt(0)) {
          isShiritoriRule = false;
        }
        
        said.add(curr);
        prev = curr;
      }

      if (isShiritoriRule) {
        System.out.println("Yes");
      } else {
        System.out.println("No");
      }
    } in.hasNext() in.hasNext in {
      HashSet<String> said = new HashSet<String>();
      int N = in.nextInt();
      String prev = in.next();
      boolean isShiritoriRule = true;

      --N;
      said.add(prev);
      while (N-- > 0){
        String curr = in.next();

        if (said.contains(curr)) {
          isShiritoriRule = false;
        }

        if (prev.charAt(prev.length() - 1) != curr.charAt(0)) {
          isShiritoriRule = false;
        }
        
        said.add(curr);
        prev = curr;
      }

      if (isShiritoriRule) {
        System.out.println("Yes");
      } else {
        System.out.println("No");
      }
    } HashSet<String> said = new HashSet<String>(); said new HashSet<String>() int N = in.nextInt(); N in.nextInt() in.nextInt in String prev = in.next(); prev in.next() in.next in boolean isShiritoriRule = true; isShiritoriRule true --N N said.add(prev) said.add said prev while (N-- > 0){
        String curr = in.next();

        if (said.contains(curr)) {
          isShiritoriRule = false;
        }

        if (prev.charAt(prev.length() - 1) != curr.charAt(0)) {
          isShiritoriRule = false;
        }
        
        said.add(curr);
        prev = curr;
      } N-- > 0 N-- N 0 {
        String curr = in.next();

        if (said.contains(curr)) {
          isShiritoriRule = false;
        }

        if (prev.charAt(prev.length() - 1) != curr.charAt(0)) {
          isShiritoriRule = false;
        }
        
        said.add(curr);
        prev = curr;
      } String curr = in.next(); curr in.next() in.next in if (said.contains(curr)) {
          isShiritoriRule = false;
        } said.contains(curr) said.contains said curr {
          isShiritoriRule = false;
        } isShiritoriRule = false isShiritoriRule false if (prev.charAt(prev.length() - 1) != curr.charAt(0)) {
          isShiritoriRule = false;
        } prev.charAt(prev.length() - 1) != curr.charAt(0) prev.charAt(prev.length() - 1) prev.charAt prev prev.length() - 1 prev.length() prev.length prev 1 curr.charAt(0) curr.charAt curr 0 {
          isShiritoriRule = false;
        } isShiritoriRule = false isShiritoriRule false said.add(curr) said.add said curr prev = curr prev curr if (isShiritoriRule) {
        System.out.println("Yes");
      } else {
        System.out.println("No");
      } isShiritoriRule {
        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 in = new Scanner(System.in);

    while (in.hasNext()) {
      HashSet<String> said = new HashSet<String>();
      int N = in.nextInt();
      String prev = in.next();
      boolean isShiritoriRule = true;

      --N;
      said.add(prev);
      while (N-- > 0){
        String curr = in.next();

        if (said.contains(curr)) {
          isShiritoriRule = false;
        }

        if (prev.charAt(prev.length() - 1) != curr.charAt(0)) {
          isShiritoriRule = false;
        }
        
        said.add(curr);
        prev = curr;
      }

      if (isShiritoriRule) {
        System.out.println("Yes");
      } else {
        System.out.println("No");
      }
    }
  }
} public class Main {
  public static void main (String[] args) {
    Scanner in = new Scanner(System.in);

    while (in.hasNext()) {
      HashSet<String> said = new HashSet<String>();
      int N = in.nextInt();
      String prev = in.next();
      boolean isShiritoriRule = true;

      --N;
      said.add(prev);
      while (N-- > 0){
        String curr = in.next();

        if (said.contains(curr)) {
          isShiritoriRule = false;
        }

        if (prev.charAt(prev.length() - 1) != curr.charAt(0)) {
          isShiritoriRule = false;
        }
        
        said.add(curr);
        prev = curr;
      }

      if (isShiritoriRule) {
        System.out.println("Yes");
      } else {
        System.out.println("No");
      }
    }
  }
} Main
import java.util.HashSet;
import java.util.Scanner;

public class Main {
  public static void main (String[] args) {
    Scanner in = new Scanner(System.in);

    while (in.hasNext()) {
      HashSet<String> said = new HashSet<String>();
      int N = in.nextInt();
      String prev = in.next();
      boolean isShiritoriRule = true;

      --N;
      said.add(prev);
      while (N-- > 0){
        String curr = in.next();

        if (said.contains(curr)) {
          isShiritoriRule = false;
        }

        if (prev.charAt(prev.length() - 1) != curr.charAt(0)) {
          isShiritoriRule = false;
        }
        
        said.add(curr);
        prev = curr;
      }

      if (isShiritoriRule) {
        System.out.println("Yes");
      } else {
        System.out.println("No");
      }
    }
  }
}