import java.util.*;
import static java.lang.System.*;
import static java.lang.Math.*;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(in);
int n=sc.nextInt();
String[] w=new String[n];
for (int i = 0; i < n; i++) {
    w[i]=sc.next();
}
HashSet<String> set=new HashSet<>();
set.add(w[0]);
for (int i = 1; i < n; i++) {
    set.add(w[i]);
    if(w[i].charAt(0)!=w[i-1].charAt(w[i-1].length()-1)){
        out.println("No");
       exit(0);
    }
}
  String ans;
if(set.size()==n){
    ans="Yes";
}else{
    ans="No";
}
  out.println(ans);
}} import java.util.*; util.* java import static java.lang.System.*; import static java.lang.System.*; import static java.lang.System.*; import static java.lang.Math.*; import static java.lang.Math.*; import static java.lang.Math.*; public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(in);
int n=sc.nextInt();
String[] w=new String[n];
for (int i = 0; i < n; i++) {
    w[i]=sc.next();
}
HashSet<String> set=new HashSet<>();
set.add(w[0]);
for (int i = 1; i < n; i++) {
    set.add(w[i]);
    if(w[i].charAt(0)!=w[i-1].charAt(w[i-1].length()-1)){
        out.println("No");
       exit(0);
    }
}
  String ans;
if(set.size()==n){
    ans="Yes";
}else{
    ans="No";
}
  out.println(ans);
}} Main public static void main(String[] args){
Scanner sc = new Scanner(in);
int n=sc.nextInt();
String[] w=new String[n];
for (int i = 0; i < n; i++) {
    w[i]=sc.next();
}
HashSet<String> set=new HashSet<>();
set.add(w[0]);
for (int i = 1; i < n; i++) {
    set.add(w[i]);
    if(w[i].charAt(0)!=w[i-1].charAt(w[i-1].length()-1)){
        out.println("No");
       exit(0);
    }
}
  String ans;
if(set.size()==n){
    ans="Yes";
}else{
    ans="No";
}
  out.println(ans);
} main {
Scanner sc = new Scanner(in);
int n=sc.nextInt();
String[] w=new String[n];
for (int i = 0; i < n; i++) {
    w[i]=sc.next();
}
HashSet<String> set=new HashSet<>();
set.add(w[0]);
for (int i = 1; i < n; i++) {
    set.add(w[i]);
    if(w[i].charAt(0)!=w[i-1].charAt(w[i-1].length()-1)){
        out.println("No");
       exit(0);
    }
}
  String ans;
if(set.size()==n){
    ans="Yes";
}else{
    ans="No";
}
  out.println(ans);
} Scanner sc = new Scanner(in); sc new Scanner(in) int n=sc.nextInt(); n sc.nextInt() sc.nextInt sc String[] w=new String[n]; w new String[n] n for (int i = 0; i < n; i++) {
    w[i]=sc.next();
} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
    w[i]=sc.next();
} {
    w[i]=sc.next();
} w[i]=sc.next() w[i] w i sc.next() sc.next sc HashSet<String> set=new HashSet<>(); set new HashSet<>() set.add(w[0]) set.add set w[0] w 0 for (int i = 1; i < n; i++) {
    set.add(w[i]);
    if(w[i].charAt(0)!=w[i-1].charAt(w[i-1].length()-1)){
        out.println("No");
       exit(0);
    }
} int i = 1; int i = 1; i 1 i < n i n i++ i++ i {
    set.add(w[i]);
    if(w[i].charAt(0)!=w[i-1].charAt(w[i-1].length()-1)){
        out.println("No");
       exit(0);
    }
} {
    set.add(w[i]);
    if(w[i].charAt(0)!=w[i-1].charAt(w[i-1].length()-1)){
        out.println("No");
       exit(0);
    }
} set.add(w[i]) set.add set w[i] w i if(w[i].charAt(0)!=w[i-1].charAt(w[i-1].length()-1)){
        out.println("No");
       exit(0);
    } w[i].charAt(0)!=w[i-1].charAt(w[i-1].length()-1) w[i].charAt(0) w[i].charAt w[i] w i 0 w[i-1].charAt(w[i-1].length()-1) w[i-1].charAt w[i-1] w i-1 i 1 w[i-1].length()-1 w[i-1].length() w[i-1].length w[i-1] w i-1 i 1 1 {
        out.println("No");
       exit(0);
    } out.println("No") out.println out "No" exit(0) exit 0 String ans; ans if(set.size()==n){
    ans="Yes";
}else{
    ans="No";
} set.size()==n set.size() set.size set n {
    ans="Yes";
} ans="Yes" ans "Yes" {
    ans="No";
} ans="No" ans "No" out.println(ans) out.println out ans String[] args args public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(in);
int n=sc.nextInt();
String[] w=new String[n];
for (int i = 0; i < n; i++) {
    w[i]=sc.next();
}
HashSet<String> set=new HashSet<>();
set.add(w[0]);
for (int i = 1; i < n; i++) {
    set.add(w[i]);
    if(w[i].charAt(0)!=w[i-1].charAt(w[i-1].length()-1)){
        out.println("No");
       exit(0);
    }
}
  String ans;
if(set.size()==n){
    ans="Yes";
}else{
    ans="No";
}
  out.println(ans);
}} public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(in);
int n=sc.nextInt();
String[] w=new String[n];
for (int i = 0; i < n; i++) {
    w[i]=sc.next();
}
HashSet<String> set=new HashSet<>();
set.add(w[0]);
for (int i = 1; i < n; i++) {
    set.add(w[i]);
    if(w[i].charAt(0)!=w[i-1].charAt(w[i-1].length()-1)){
        out.println("No");
       exit(0);
    }
}
  String ans;
if(set.size()==n){
    ans="Yes";
}else{
    ans="No";
}
  out.println(ans);
}} Main
import java.util.*;
import static java.lang.System.*;
import static java.lang.Math.*;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(in);
int n=sc.nextInt();
String[] w=new String[n];
for (int i = 0; i < n; i++) {
    w[i]=sc.next();
}
HashSet<String> set=new HashSet<>();
set.add(w[0]);
for (int i = 1; i < n; i++) {
    set.add(w[i]);
    if(w[i].charAt(0)!=w[i-1].charAt(w[i-1].length()-1)){
        out.println("No");
       exit(0);
    }
}
  String ans;
if(set.size()==n){
    ans="Yes";
}else{
    ans="No";
}
  out.println(ans);
}}
