import java.nio.file.FileSystemAlreadyExistsException;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        List<String> words = new ArrayList<>();
        boolean failed = false;

        for (int i = 0; i < N; i++) {
            String currentWord = sc.next();
            
            if (i == 0) {
                words.add(currentWord);
            } else {
                String prevWord = words.get(words.size() - 1);
                if (prevWord.substring(prevWord.length() - 1, prevWord.length()).equals(currentWord.substring(0, 1))) {
                    boolean sameWordFlg = false;
                    for (String element : words) {
                        if (element != null && element.equals(currentWord)) {
                            sameWordFlg = true;
                            break;
                        }
                    }
                    if (!sameWordFlg) {
                        words.add(currentWord);
                    } else {
                        failed = true;
                    }
                }  else {
                    failed = true;
                }
            }
        }

        if (failed) {
            System.out.println("No");
        } else {
            System.out.println("Yes");
        }
    }
} import java.nio.file.FileSystemAlreadyExistsException; FileSystemAlreadyExistsException java.nio.file import java.util.ArrayList; ArrayList java.util import java.util.List; List java.util import java.util.Scanner; Scanner java.util class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        List<String> words = new ArrayList<>();
        boolean failed = false;

        for (int i = 0; i < N; i++) {
            String currentWord = sc.next();
            
            if (i == 0) {
                words.add(currentWord);
            } else {
                String prevWord = words.get(words.size() - 1);
                if (prevWord.substring(prevWord.length() - 1, prevWord.length()).equals(currentWord.substring(0, 1))) {
                    boolean sameWordFlg = false;
                    for (String element : words) {
                        if (element != null && element.equals(currentWord)) {
                            sameWordFlg = true;
                            break;
                        }
                    }
                    if (!sameWordFlg) {
                        words.add(currentWord);
                    } else {
                        failed = true;
                    }
                }  else {
                    failed = true;
                }
            }
        }

        if (failed) {
            System.out.println("No");
        } else {
            System.out.println("Yes");
        }
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        List<String> words = new ArrayList<>();
        boolean failed = false;

        for (int i = 0; i < N; i++) {
            String currentWord = sc.next();
            
            if (i == 0) {
                words.add(currentWord);
            } else {
                String prevWord = words.get(words.size() - 1);
                if (prevWord.substring(prevWord.length() - 1, prevWord.length()).equals(currentWord.substring(0, 1))) {
                    boolean sameWordFlg = false;
                    for (String element : words) {
                        if (element != null && element.equals(currentWord)) {
                            sameWordFlg = true;
                            break;
                        }
                    }
                    if (!sameWordFlg) {
                        words.add(currentWord);
                    } else {
                        failed = true;
                    }
                }  else {
                    failed = true;
                }
            }
        }

        if (failed) {
            System.out.println("No");
        } else {
            System.out.println("Yes");
        }
    } main {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        List<String> words = new ArrayList<>();
        boolean failed = false;

        for (int i = 0; i < N; i++) {
            String currentWord = sc.next();
            
            if (i == 0) {
                words.add(currentWord);
            } else {
                String prevWord = words.get(words.size() - 1);
                if (prevWord.substring(prevWord.length() - 1, prevWord.length()).equals(currentWord.substring(0, 1))) {
                    boolean sameWordFlg = false;
                    for (String element : words) {
                        if (element != null && element.equals(currentWord)) {
                            sameWordFlg = true;
                            break;
                        }
                    }
                    if (!sameWordFlg) {
                        words.add(currentWord);
                    } else {
                        failed = true;
                    }
                }  else {
                    failed = true;
                }
            }
        }

        if (failed) {
            System.out.println("No");
        } else {
            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 List<String> words = new ArrayList<>(); words new ArrayList<>() boolean failed = false; failed false for (int i = 0; i < N; i++) {
            String currentWord = sc.next();
            
            if (i == 0) {
                words.add(currentWord);
            } else {
                String prevWord = words.get(words.size() - 1);
                if (prevWord.substring(prevWord.length() - 1, prevWord.length()).equals(currentWord.substring(0, 1))) {
                    boolean sameWordFlg = false;
                    for (String element : words) {
                        if (element != null && element.equals(currentWord)) {
                            sameWordFlg = true;
                            break;
                        }
                    }
                    if (!sameWordFlg) {
                        words.add(currentWord);
                    } else {
                        failed = true;
                    }
                }  else {
                    failed = true;
                }
            }
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            String currentWord = sc.next();
            
            if (i == 0) {
                words.add(currentWord);
            } else {
                String prevWord = words.get(words.size() - 1);
                if (prevWord.substring(prevWord.length() - 1, prevWord.length()).equals(currentWord.substring(0, 1))) {
                    boolean sameWordFlg = false;
                    for (String element : words) {
                        if (element != null && element.equals(currentWord)) {
                            sameWordFlg = true;
                            break;
                        }
                    }
                    if (!sameWordFlg) {
                        words.add(currentWord);
                    } else {
                        failed = true;
                    }
                }  else {
                    failed = true;
                }
            }
        } {
            String currentWord = sc.next();
            
            if (i == 0) {
                words.add(currentWord);
            } else {
                String prevWord = words.get(words.size() - 1);
                if (prevWord.substring(prevWord.length() - 1, prevWord.length()).equals(currentWord.substring(0, 1))) {
                    boolean sameWordFlg = false;
                    for (String element : words) {
                        if (element != null && element.equals(currentWord)) {
                            sameWordFlg = true;
                            break;
                        }
                    }
                    if (!sameWordFlg) {
                        words.add(currentWord);
                    } else {
                        failed = true;
                    }
                }  else {
                    failed = true;
                }
            }
        } String currentWord = sc.next(); currentWord sc.next() sc.next sc if (i == 0) {
                words.add(currentWord);
            } else {
                String prevWord = words.get(words.size() - 1);
                if (prevWord.substring(prevWord.length() - 1, prevWord.length()).equals(currentWord.substring(0, 1))) {
                    boolean sameWordFlg = false;
                    for (String element : words) {
                        if (element != null && element.equals(currentWord)) {
                            sameWordFlg = true;
                            break;
                        }
                    }
                    if (!sameWordFlg) {
                        words.add(currentWord);
                    } else {
                        failed = true;
                    }
                }  else {
                    failed = true;
                }
            } i == 0 i 0 {
                words.add(currentWord);
            } words.add(currentWord) words.add words currentWord {
                String prevWord = words.get(words.size() - 1);
                if (prevWord.substring(prevWord.length() - 1, prevWord.length()).equals(currentWord.substring(0, 1))) {
                    boolean sameWordFlg = false;
                    for (String element : words) {
                        if (element != null && element.equals(currentWord)) {
                            sameWordFlg = true;
                            break;
                        }
                    }
                    if (!sameWordFlg) {
                        words.add(currentWord);
                    } else {
                        failed = true;
                    }
                }  else {
                    failed = true;
                }
            } String prevWord = words.get(words.size() - 1); prevWord words.get(words.size() - 1) words.get words words.size() - 1 words.size() words.size words 1 if (prevWord.substring(prevWord.length() - 1, prevWord.length()).equals(currentWord.substring(0, 1))) {
                    boolean sameWordFlg = false;
                    for (String element : words) {
                        if (element != null && element.equals(currentWord)) {
                            sameWordFlg = true;
                            break;
                        }
                    }
                    if (!sameWordFlg) {
                        words.add(currentWord);
                    } else {
                        failed = true;
                    }
                }  else {
                    failed = true;
                } prevWord.substring(prevWord.length() - 1, prevWord.length()).equals(currentWord.substring(0, 1)) prevWord.substring(prevWord.length() - 1, prevWord.length()).equals prevWord.substring(prevWord.length() - 1, prevWord.length()) prevWord.substring prevWord prevWord.length() - 1 prevWord.length() prevWord.length prevWord 1 prevWord.length() prevWord.length prevWord currentWord.substring(0, 1) currentWord.substring currentWord 0 1 {
                    boolean sameWordFlg = false;
                    for (String element : words) {
                        if (element != null && element.equals(currentWord)) {
                            sameWordFlg = true;
                            break;
                        }
                    }
                    if (!sameWordFlg) {
                        words.add(currentWord);
                    } else {
                        failed = true;
                    }
                } boolean sameWordFlg = false; sameWordFlg false for (String element : words) {
                        if (element != null && element.equals(currentWord)) {
                            sameWordFlg = true;
                            break;
                        }
                    } String element words {
                        if (element != null && element.equals(currentWord)) {
                            sameWordFlg = true;
                            break;
                        }
                    } {
                        if (element != null && element.equals(currentWord)) {
                            sameWordFlg = true;
                            break;
                        }
                    } if (element != null && element.equals(currentWord)) {
                            sameWordFlg = true;
                            break;
                        } element != null && element.equals(currentWord) element != null element null element.equals(currentWord) element.equals element currentWord {
                            sameWordFlg = true;
                            break;
                        } sameWordFlg = true sameWordFlg true break; if (!sameWordFlg) {
                        words.add(currentWord);
                    } else {
                        failed = true;
                    } !sameWordFlg sameWordFlg {
                        words.add(currentWord);
                    } words.add(currentWord) words.add words currentWord {
                        failed = true;
                    } failed = true failed true {
                    failed = true;
                } failed = true failed true if (failed) {
            System.out.println("No");
        } else {
            System.out.println("Yes");
        } failed {
            System.out.println("No");
        } System.out.println("No") System.out.println System.out System System.out "No" {
            System.out.println("Yes");
        } System.out.println("Yes") System.out.println System.out System System.out "Yes" String[] args args
import java.nio.file.FileSystemAlreadyExistsException;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        List<String> words = new ArrayList<>();
        boolean failed = false;

        for (int i = 0; i < N; i++) {
            String currentWord = sc.next();
            
            if (i == 0) {
                words.add(currentWord);
            } else {
                String prevWord = words.get(words.size() - 1);
                if (prevWord.substring(prevWord.length() - 1, prevWord.length()).equals(currentWord.substring(0, 1))) {
                    boolean sameWordFlg = false;
                    for (String element : words) {
                        if (element != null && element.equals(currentWord)) {
                            sameWordFlg = true;
                            break;
                        }
                    }
                    if (!sameWordFlg) {
                        words.add(currentWord);
                    } else {
                        failed = true;
                    }
                }  else {
                    failed = true;
                }
            }
        }

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