import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
 
public class Main {
 
    public static void main(String[] args) {
 
        Scanner scanner = new Scanner(System.in);
        int count = scanner.nextInt();
 
        List<String> list = new ArrayList<>();
 
        for (int i = 0; i < count; ++i)
            list.add(scanner.next());
 
        if (list.stream().distinct().count() < list.size()) {
            System.out.println("No");
            return;
        }
 
        boolean isSuccess = true;
        for (int i = 1; i < list.size(); ++i) {
            if (!list.get(i).startsWith("" + list.get(i - 1).toCharArray()[list.get(i - 1).length() - 1])) {
                isSuccess = false;
                break;
            }
        }
 
        if (isSuccess)
            System.out.println("Yes");
        else
            System.out.println("No");
    }
} import java.util.ArrayList; ArrayList java.util import java.util.List; List java.util import java.util.Scanner; Scanner java.util public class Main {
 
    public static void main(String[] args) {
 
        Scanner scanner = new Scanner(System.in);
        int count = scanner.nextInt();
 
        List<String> list = new ArrayList<>();
 
        for (int i = 0; i < count; ++i)
            list.add(scanner.next());
 
        if (list.stream().distinct().count() < list.size()) {
            System.out.println("No");
            return;
        }
 
        boolean isSuccess = true;
        for (int i = 1; i < list.size(); ++i) {
            if (!list.get(i).startsWith("" + list.get(i - 1).toCharArray()[list.get(i - 1).length() - 1])) {
                isSuccess = false;
                break;
            }
        }
 
        if (isSuccess)
            System.out.println("Yes");
        else
            System.out.println("No");
    }
} Main public static void main(String[] args) {
 
        Scanner scanner = new Scanner(System.in);
        int count = scanner.nextInt();
 
        List<String> list = new ArrayList<>();
 
        for (int i = 0; i < count; ++i)
            list.add(scanner.next());
 
        if (list.stream().distinct().count() < list.size()) {
            System.out.println("No");
            return;
        }
 
        boolean isSuccess = true;
        for (int i = 1; i < list.size(); ++i) {
            if (!list.get(i).startsWith("" + list.get(i - 1).toCharArray()[list.get(i - 1).length() - 1])) {
                isSuccess = false;
                break;
            }
        }
 
        if (isSuccess)
            System.out.println("Yes");
        else
            System.out.println("No");
    } main {
 
        Scanner scanner = new Scanner(System.in);
        int count = scanner.nextInt();
 
        List<String> list = new ArrayList<>();
 
        for (int i = 0; i < count; ++i)
            list.add(scanner.next());
 
        if (list.stream().distinct().count() < list.size()) {
            System.out.println("No");
            return;
        }
 
        boolean isSuccess = true;
        for (int i = 1; i < list.size(); ++i) {
            if (!list.get(i).startsWith("" + list.get(i - 1).toCharArray()[list.get(i - 1).length() - 1])) {
                isSuccess = false;
                break;
            }
        }
 
        if (isSuccess)
            System.out.println("Yes");
        else
            System.out.println("No");
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int count = scanner.nextInt(); count scanner.nextInt() scanner.nextInt scanner List<String> list = new ArrayList<>(); list new ArrayList<>() for (int i = 0; i < count; ++i)
            list.add(scanner.next()); int i = 0; int i = 0; i 0 i < count i count ++i ++i i list.add(scanner.next()); list.add(scanner.next()) list.add list scanner.next() scanner.next scanner if (list.stream().distinct().count() < list.size()) {
            System.out.println("No");
            return;
        } list.stream().distinct().count() < list.size() list.stream().distinct().count() list.stream().distinct().count list.stream().distinct() list.stream().distinct list.stream() list.stream list list.size() list.size list {
            System.out.println("No");
            return;
        } System.out.println("No") System.out.println System.out System System.out "No" return; boolean isSuccess = true; isSuccess true for (int i = 1; i < list.size(); ++i) {
            if (!list.get(i).startsWith("" + list.get(i - 1).toCharArray()[list.get(i - 1).length() - 1])) {
                isSuccess = false;
                break;
            }
        } int i = 1; int i = 1; i 1 i < list.size() i list.size() list.size list ++i ++i i {
            if (!list.get(i).startsWith("" + list.get(i - 1).toCharArray()[list.get(i - 1).length() - 1])) {
                isSuccess = false;
                break;
            }
        } {
            if (!list.get(i).startsWith("" + list.get(i - 1).toCharArray()[list.get(i - 1).length() - 1])) {
                isSuccess = false;
                break;
            }
        } if (!list.get(i).startsWith("" + list.get(i - 1).toCharArray()[list.get(i - 1).length() - 1])) {
                isSuccess = false;
                break;
            } !list.get(i).startsWith("" + list.get(i - 1).toCharArray()[list.get(i - 1).length() - 1]) list.get(i).startsWith("" + list.get(i - 1).toCharArray()[list.get(i - 1).length() - 1]) list.get(i).startsWith list.get(i) list.get list i "" + list.get(i - 1).toCharArray()[list.get(i - 1).length() - 1] "" list.get(i - 1).toCharArray()[list.get(i - 1).length() - 1] list.get(i - 1).toCharArray() list.get(i - 1).toCharArray list.get(i - 1) list.get list i - 1 i 1 list.get(i - 1).length() - 1 list.get(i - 1).length() list.get(i - 1).length list.get(i - 1) list.get list i - 1 i 1 1 {
                isSuccess = false;
                break;
            } isSuccess = false isSuccess false break; if (isSuccess)
            System.out.println("Yes");
        else
            System.out.println("No"); isSuccess 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) {
 
        Scanner scanner = new Scanner(System.in);
        int count = scanner.nextInt();
 
        List<String> list = new ArrayList<>();
 
        for (int i = 0; i < count; ++i)
            list.add(scanner.next());
 
        if (list.stream().distinct().count() < list.size()) {
            System.out.println("No");
            return;
        }
 
        boolean isSuccess = true;
        for (int i = 1; i < list.size(); ++i) {
            if (!list.get(i).startsWith("" + list.get(i - 1).toCharArray()[list.get(i - 1).length() - 1])) {
                isSuccess = false;
                break;
            }
        }
 
        if (isSuccess)
            System.out.println("Yes");
        else
            System.out.println("No");
    }
} public class Main {
 
    public static void main(String[] args) {
 
        Scanner scanner = new Scanner(System.in);
        int count = scanner.nextInt();
 
        List<String> list = new ArrayList<>();
 
        for (int i = 0; i < count; ++i)
            list.add(scanner.next());
 
        if (list.stream().distinct().count() < list.size()) {
            System.out.println("No");
            return;
        }
 
        boolean isSuccess = true;
        for (int i = 1; i < list.size(); ++i) {
            if (!list.get(i).startsWith("" + list.get(i - 1).toCharArray()[list.get(i - 1).length() - 1])) {
                isSuccess = false;
                break;
            }
        }
 
        if (isSuccess)
            System.out.println("Yes");
        else
            System.out.println("No");
    }
} Main
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
 
public class Main {
 
    public static void main(String[] args) {
 
        Scanner scanner = new Scanner(System.in);
        int count = scanner.nextInt();
 
        List<String> list = new ArrayList<>();
 
        for (int i = 0; i < count; ++i)
            list.add(scanner.next());
 
        if (list.stream().distinct().count() < list.size()) {
            System.out.println("No");
            return;
        }
 
        boolean isSuccess = true;
        for (int i = 1; i < list.size(); ++i) {
            if (!list.get(i).startsWith("" + list.get(i - 1).toCharArray()[list.get(i - 1).length() - 1])) {
                isSuccess = false;
                break;
            }
        }
 
        if (isSuccess)
            System.out.println("Yes");
        else
            System.out.println("No");
    }
}