import java.util.*;
public class Main {
	public static void main(String[] args){
      boolean ok_flag = true;
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
      List<String> list = new ArrayList<>();
      for(int i=0; i<n; i++){
list.add(sc.next());
      }
Set<String> set = new HashSet<>(list);
List<String> list2 = new ArrayList<>(set);

 if(n!=list2.size()) {
   System.out.println("No");
   System.exit(0);
 }
      for(int i=1; i<list.size(); i++){
      String str_end = list.get(i-1);
      String str_str = list.get(i);
      char c_end = str_end.charAt(str_end.length()-1);
        char c_str = str_str.charAt(0);
        if(c_end != c_str) ok_flag = false;
      }
      if(ok_flag) System.out.println("Yes");
      else System.out.println("No");
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args){
      boolean ok_flag = true;
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
      List<String> list = new ArrayList<>();
      for(int i=0; i<n; i++){
list.add(sc.next());
      }
Set<String> set = new HashSet<>(list);
List<String> list2 = new ArrayList<>(set);

 if(n!=list2.size()) {
   System.out.println("No");
   System.exit(0);
 }
      for(int i=1; i<list.size(); i++){
      String str_end = list.get(i-1);
      String str_str = list.get(i);
      char c_end = str_end.charAt(str_end.length()-1);
        char c_str = str_str.charAt(0);
        if(c_end != c_str) ok_flag = false;
      }
      if(ok_flag) System.out.println("Yes");
      else System.out.println("No");
	}
} Main public static void main(String[] args){
      boolean ok_flag = true;
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
      List<String> list = new ArrayList<>();
      for(int i=0; i<n; i++){
list.add(sc.next());
      }
Set<String> set = new HashSet<>(list);
List<String> list2 = new ArrayList<>(set);

 if(n!=list2.size()) {
   System.out.println("No");
   System.exit(0);
 }
      for(int i=1; i<list.size(); i++){
      String str_end = list.get(i-1);
      String str_str = list.get(i);
      char c_end = str_end.charAt(str_end.length()-1);
        char c_str = str_str.charAt(0);
        if(c_end != c_str) ok_flag = false;
      }
      if(ok_flag) System.out.println("Yes");
      else System.out.println("No");
	} main {
      boolean ok_flag = true;
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
      List<String> list = new ArrayList<>();
      for(int i=0; i<n; i++){
list.add(sc.next());
      }
Set<String> set = new HashSet<>(list);
List<String> list2 = new ArrayList<>(set);

 if(n!=list2.size()) {
   System.out.println("No");
   System.exit(0);
 }
      for(int i=1; i<list.size(); i++){
      String str_end = list.get(i-1);
      String str_str = list.get(i);
      char c_end = str_end.charAt(str_end.length()-1);
        char c_str = str_str.charAt(0);
        if(c_end != c_str) ok_flag = false;
      }
      if(ok_flag) System.out.println("Yes");
      else System.out.println("No");
	} boolean ok_flag = true; ok_flag true Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc List<String> list = new ArrayList<>(); list new ArrayList<>() for(int i=0; i<n; i++){
list.add(sc.next());
      } int i=0; int i=0; i 0 i<n i n i++ i++ i {
list.add(sc.next());
      } {
list.add(sc.next());
      } list.add(sc.next()) list.add list sc.next() sc.next sc Set<String> set = new HashSet<>(list); set new HashSet<>(list) List<String> list2 = new ArrayList<>(set); list2 new ArrayList<>(set) if(n!=list2.size()) {
   System.out.println("No");
   System.exit(0);
 } n!=list2.size() n list2.size() list2.size list2 {
   System.out.println("No");
   System.exit(0);
 } System.out.println("No") System.out.println System.out System System.out "No" System.exit(0) System.exit System 0 for(int i=1; i<list.size(); i++){
      String str_end = list.get(i-1);
      String str_str = list.get(i);
      char c_end = str_end.charAt(str_end.length()-1);
        char c_str = str_str.charAt(0);
        if(c_end != c_str) ok_flag = false;
      } int i=1; int i=1; i 1 i<list.size() i list.size() list.size list i++ i++ i {
      String str_end = list.get(i-1);
      String str_str = list.get(i);
      char c_end = str_end.charAt(str_end.length()-1);
        char c_str = str_str.charAt(0);
        if(c_end != c_str) ok_flag = false;
      } {
      String str_end = list.get(i-1);
      String str_str = list.get(i);
      char c_end = str_end.charAt(str_end.length()-1);
        char c_str = str_str.charAt(0);
        if(c_end != c_str) ok_flag = false;
      } String str_end = list.get(i-1); str_end list.get(i-1) list.get list i-1 i 1 String str_str = list.get(i); str_str list.get(i) list.get list i char c_end = str_end.charAt(str_end.length()-1); c_end str_end.charAt(str_end.length()-1) str_end.charAt str_end str_end.length()-1 str_end.length() str_end.length str_end 1 char c_str = str_str.charAt(0); c_str str_str.charAt(0) str_str.charAt str_str 0 if(c_end != c_str) ok_flag = false; c_end != c_str c_end c_str ok_flag = false ok_flag false if(ok_flag) System.out.println("Yes");
      else System.out.println("No"); ok_flag System.out.println("Yes") System.out.println System.out System System.out "Yes" 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){
      boolean ok_flag = true;
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
      List<String> list = new ArrayList<>();
      for(int i=0; i<n; i++){
list.add(sc.next());
      }
Set<String> set = new HashSet<>(list);
List<String> list2 = new ArrayList<>(set);

 if(n!=list2.size()) {
   System.out.println("No");
   System.exit(0);
 }
      for(int i=1; i<list.size(); i++){
      String str_end = list.get(i-1);
      String str_str = list.get(i);
      char c_end = str_end.charAt(str_end.length()-1);
        char c_str = str_str.charAt(0);
        if(c_end != c_str) ok_flag = false;
      }
      if(ok_flag) System.out.println("Yes");
      else System.out.println("No");
	}
} public class Main {
	public static void main(String[] args){
      boolean ok_flag = true;
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
      List<String> list = new ArrayList<>();
      for(int i=0; i<n; i++){
list.add(sc.next());
      }
Set<String> set = new HashSet<>(list);
List<String> list2 = new ArrayList<>(set);

 if(n!=list2.size()) {
   System.out.println("No");
   System.exit(0);
 }
      for(int i=1; i<list.size(); i++){
      String str_end = list.get(i-1);
      String str_str = list.get(i);
      char c_end = str_end.charAt(str_end.length()-1);
        char c_str = str_str.charAt(0);
        if(c_end != c_str) ok_flag = false;
      }
      if(ok_flag) System.out.println("Yes");
      else System.out.println("No");
	}
} Main
import java.util.*;
public class Main {
	public static void main(String[] args){
      boolean ok_flag = true;
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
      List<String> list = new ArrayList<>();
      for(int i=0; i<n; i++){
list.add(sc.next());
      }
Set<String> set = new HashSet<>(list);
List<String> list2 = new ArrayList<>(set);

 if(n!=list2.size()) {
   System.out.println("No");
   System.exit(0);
 }
      for(int i=1; i<list.size(); i++){
      String str_end = list.get(i-1);
      String str_str = list.get(i);
      char c_end = str_end.charAt(str_end.length()-1);
        char c_str = str_str.charAt(0);
        if(c_end != c_str) ok_flag = false;
      }
      if(ok_flag) System.out.println("Yes");
      else System.out.println("No");
	}
}
