import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner scan = new Scanner(System.in);
        
        // 標準入力の取得
        int N = Integer.parseInt(scan.nextLine());

        List<String> W = new ArrayList<String>(N);
        for (int i = 0; i < N; i++) {
            W.add(scan.nextLine());
        }

        // 重複チェック
        Set<String> Wst = new HashSet<String>(W);
        if(!(Wst.size() == W.size())){
            System.out.println("No");
            return ;
        }
        
        // しりとりできてるかチェック
        String prev = "";
        String next = "";
        for (int i = 0; i < N-1; i++) {
            prev = W.get(i);
            next = W.get(i+1);
            
            if(prev.charAt(prev.length() - 1) != next.charAt(0)){
                System.out.println("No");
                return ; 
            }
        }
        System.out.println("Yes");
        return ; 
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        Scanner scan = new Scanner(System.in);
        
        // 標準入力の取得
        int N = Integer.parseInt(scan.nextLine());

        List<String> W = new ArrayList<String>(N);
        for (int i = 0; i < N; i++) {
            W.add(scan.nextLine());
        }

        // 重複チェック
        Set<String> Wst = new HashSet<String>(W);
        if(!(Wst.size() == W.size())){
            System.out.println("No");
            return ;
        }
        
        // しりとりできてるかチェック
        String prev = "";
        String next = "";
        for (int i = 0; i < N-1; i++) {
            prev = W.get(i);
            next = W.get(i+1);
            
            if(prev.charAt(prev.length() - 1) != next.charAt(0)){
                System.out.println("No");
                return ; 
            }
        }
        System.out.println("Yes");
        return ; 
    }
} Main public static void main(String[] args) throws Exception {
        Scanner scan = new Scanner(System.in);
        
        // 標準入力の取得
        int N = Integer.parseInt(scan.nextLine());

        List<String> W = new ArrayList<String>(N);
        for (int i = 0; i < N; i++) {
            W.add(scan.nextLine());
        }

        // 重複チェック
        Set<String> Wst = new HashSet<String>(W);
        if(!(Wst.size() == W.size())){
            System.out.println("No");
            return ;
        }
        
        // しりとりできてるかチェック
        String prev = "";
        String next = "";
        for (int i = 0; i < N-1; i++) {
            prev = W.get(i);
            next = W.get(i+1);
            
            if(prev.charAt(prev.length() - 1) != next.charAt(0)){
                System.out.println("No");
                return ; 
            }
        }
        System.out.println("Yes");
        return ; 
    } main {
        Scanner scan = new Scanner(System.in);
        
        // 標準入力の取得
        int N = Integer.parseInt(scan.nextLine());

        List<String> W = new ArrayList<String>(N);
        for (int i = 0; i < N; i++) {
            W.add(scan.nextLine());
        }

        // 重複チェック
        Set<String> Wst = new HashSet<String>(W);
        if(!(Wst.size() == W.size())){
            System.out.println("No");
            return ;
        }
        
        // しりとりできてるかチェック
        String prev = "";
        String next = "";
        for (int i = 0; i < N-1; i++) {
            prev = W.get(i);
            next = W.get(i+1);
            
            if(prev.charAt(prev.length() - 1) != next.charAt(0)){
                System.out.println("No");
                return ; 
            }
        }
        System.out.println("Yes");
        return ; 
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int N = Integer.parseInt(scan.nextLine()); N Integer.parseInt(scan.nextLine()) Integer.parseInt Integer scan.nextLine() scan.nextLine scan List<String> W = new ArrayList<String>(N); W new ArrayList<String>(N) for (int i = 0; i < N; i++) {
            W.add(scan.nextLine());
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            W.add(scan.nextLine());
        } {
            W.add(scan.nextLine());
        } W.add(scan.nextLine()) W.add W scan.nextLine() scan.nextLine scan Set<String> Wst = new HashSet<String>(W); Wst new HashSet<String>(W) if(!(Wst.size() == W.size())){
            System.out.println("No");
            return ;
        } !(Wst.size() == W.size()) (Wst.size() == W.size()) Wst.size() Wst.size Wst W.size() W.size W {
            System.out.println("No");
            return ;
        } System.out.println("No") System.out.println System.out System System.out "No" return ; String prev = ""; prev "" String next = ""; next "" for (int i = 0; i < N-1; i++) {
            prev = W.get(i);
            next = W.get(i+1);
            
            if(prev.charAt(prev.length() - 1) != next.charAt(0)){
                System.out.println("No");
                return ; 
            }
        } int i = 0; int i = 0; i 0 i < N-1 i N-1 N 1 i++ i++ i {
            prev = W.get(i);
            next = W.get(i+1);
            
            if(prev.charAt(prev.length() - 1) != next.charAt(0)){
                System.out.println("No");
                return ; 
            }
        } {
            prev = W.get(i);
            next = W.get(i+1);
            
            if(prev.charAt(prev.length() - 1) != next.charAt(0)){
                System.out.println("No");
                return ; 
            }
        } prev = W.get(i) prev W.get(i) W.get W i next = W.get(i+1) next W.get(i+1) W.get W i+1 i 1 if(prev.charAt(prev.length() - 1) != next.charAt(0)){
                System.out.println("No");
                return ; 
            } prev.charAt(prev.length() - 1) != next.charAt(0) prev.charAt(prev.length() - 1) prev.charAt prev prev.length() - 1 prev.length() prev.length prev 1 next.charAt(0) next.charAt next 0 {
                System.out.println("No");
                return ; 
            } System.out.println("No") System.out.println System.out System System.out "No" return ; System.out.println("Yes") System.out.println System.out System System.out "Yes" return ; String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        Scanner scan = new Scanner(System.in);
        
        // 標準入力の取得
        int N = Integer.parseInt(scan.nextLine());

        List<String> W = new ArrayList<String>(N);
        for (int i = 0; i < N; i++) {
            W.add(scan.nextLine());
        }

        // 重複チェック
        Set<String> Wst = new HashSet<String>(W);
        if(!(Wst.size() == W.size())){
            System.out.println("No");
            return ;
        }
        
        // しりとりできてるかチェック
        String prev = "";
        String next = "";
        for (int i = 0; i < N-1; i++) {
            prev = W.get(i);
            next = W.get(i+1);
            
            if(prev.charAt(prev.length() - 1) != next.charAt(0)){
                System.out.println("No");
                return ; 
            }
        }
        System.out.println("Yes");
        return ; 
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        Scanner scan = new Scanner(System.in);
        
        // 標準入力の取得
        int N = Integer.parseInt(scan.nextLine());

        List<String> W = new ArrayList<String>(N);
        for (int i = 0; i < N; i++) {
            W.add(scan.nextLine());
        }

        // 重複チェック
        Set<String> Wst = new HashSet<String>(W);
        if(!(Wst.size() == W.size())){
            System.out.println("No");
            return ;
        }
        
        // しりとりできてるかチェック
        String prev = "";
        String next = "";
        for (int i = 0; i < N-1; i++) {
            prev = W.get(i);
            next = W.get(i+1);
            
            if(prev.charAt(prev.length() - 1) != next.charAt(0)){
                System.out.println("No");
                return ; 
            }
        }
        System.out.println("Yes");
        return ; 
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner scan = new Scanner(System.in);
        
        // 標準入力の取得
        int N = Integer.parseInt(scan.nextLine());

        List<String> W = new ArrayList<String>(N);
        for (int i = 0; i < N; i++) {
            W.add(scan.nextLine());
        }

        // 重複チェック
        Set<String> Wst = new HashSet<String>(W);
        if(!(Wst.size() == W.size())){
            System.out.println("No");
            return ;
        }
        
        // しりとりできてるかチェック
        String prev = "";
        String next = "";
        for (int i = 0; i < N-1; i++) {
            prev = W.get(i);
            next = W.get(i+1);
            
            if(prev.charAt(prev.length() - 1) != next.charAt(0)){
                System.out.println("No");
                return ; 
            }
        }
        System.out.println("Yes");
        return ; 
    }
}
