import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int num = Integer.parseInt(in.nextLine());
        List<String> words = new ArrayList<String>();
        boolean isRight = true;
        while(in.hasNextLine()) {
        	String cache = in.nextLine();
            if (words.contains(cache)) {
            	isRight = false;
            	break;
            }
            words.add(cache);
        }
        in.close();
        if (isRight) {
        	char a = ' ';
        	for(String word : words) {
        		if (a == ' ' || a == word.charAt(0)) {
        		a = word.charAt(word.length() - 1);
        		} else {
        			isRight = false;
        		}
        	}
        }
        String ans = isRight ? "Yes" : "No";
        System.out.println(ans);
    }
} 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 in = new Scanner(System.in);
        int num = Integer.parseInt(in.nextLine());
        List<String> words = new ArrayList<String>();
        boolean isRight = true;
        while(in.hasNextLine()) {
        	String cache = in.nextLine();
            if (words.contains(cache)) {
            	isRight = false;
            	break;
            }
            words.add(cache);
        }
        in.close();
        if (isRight) {
        	char a = ' ';
        	for(String word : words) {
        		if (a == ' ' || a == word.charAt(0)) {
        		a = word.charAt(word.length() - 1);
        		} else {
        			isRight = false;
        		}
        	}
        }
        String ans = isRight ? "Yes" : "No";
        System.out.println(ans);
    }
} Main public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int num = Integer.parseInt(in.nextLine());
        List<String> words = new ArrayList<String>();
        boolean isRight = true;
        while(in.hasNextLine()) {
        	String cache = in.nextLine();
            if (words.contains(cache)) {
            	isRight = false;
            	break;
            }
            words.add(cache);
        }
        in.close();
        if (isRight) {
        	char a = ' ';
        	for(String word : words) {
        		if (a == ' ' || a == word.charAt(0)) {
        		a = word.charAt(word.length() - 1);
        		} else {
        			isRight = false;
        		}
        	}
        }
        String ans = isRight ? "Yes" : "No";
        System.out.println(ans);
    } main {
        Scanner in = new Scanner(System.in);
        int num = Integer.parseInt(in.nextLine());
        List<String> words = new ArrayList<String>();
        boolean isRight = true;
        while(in.hasNextLine()) {
        	String cache = in.nextLine();
            if (words.contains(cache)) {
            	isRight = false;
            	break;
            }
            words.add(cache);
        }
        in.close();
        if (isRight) {
        	char a = ' ';
        	for(String word : words) {
        		if (a == ' ' || a == word.charAt(0)) {
        		a = word.charAt(word.length() - 1);
        		} else {
        			isRight = false;
        		}
        	}
        }
        String ans = isRight ? "Yes" : "No";
        System.out.println(ans);
    } Scanner in = new Scanner(System.in); in new Scanner(System.in) int num = Integer.parseInt(in.nextLine()); num Integer.parseInt(in.nextLine()) Integer.parseInt Integer in.nextLine() in.nextLine in List<String> words = new ArrayList<String>(); words new ArrayList<String>() boolean isRight = true; isRight true while(in.hasNextLine()) {
        	String cache = in.nextLine();
            if (words.contains(cache)) {
            	isRight = false;
            	break;
            }
            words.add(cache);
        } in.hasNextLine() in.hasNextLine in {
        	String cache = in.nextLine();
            if (words.contains(cache)) {
            	isRight = false;
            	break;
            }
            words.add(cache);
        } String cache = in.nextLine(); cache in.nextLine() in.nextLine in if (words.contains(cache)) {
            	isRight = false;
            	break;
            } words.contains(cache) words.contains words cache {
            	isRight = false;
            	break;
            } isRight = false isRight false break; words.add(cache) words.add words cache in.close() in.close in if (isRight) {
        	char a = ' ';
        	for(String word : words) {
        		if (a == ' ' || a == word.charAt(0)) {
        		a = word.charAt(word.length() - 1);
        		} else {
        			isRight = false;
        		}
        	}
        } isRight {
        	char a = ' ';
        	for(String word : words) {
        		if (a == ' ' || a == word.charAt(0)) {
        		a = word.charAt(word.length() - 1);
        		} else {
        			isRight = false;
        		}
        	}
        } char a = ' '; a ' ' for(String word : words) {
        		if (a == ' ' || a == word.charAt(0)) {
        		a = word.charAt(word.length() - 1);
        		} else {
        			isRight = false;
        		}
        	} String word words {
        		if (a == ' ' || a == word.charAt(0)) {
        		a = word.charAt(word.length() - 1);
        		} else {
        			isRight = false;
        		}
        	} {
        		if (a == ' ' || a == word.charAt(0)) {
        		a = word.charAt(word.length() - 1);
        		} else {
        			isRight = false;
        		}
        	} if (a == ' ' || a == word.charAt(0)) {
        		a = word.charAt(word.length() - 1);
        		} else {
        			isRight = false;
        		} a == ' ' || a == word.charAt(0) a == ' ' a ' ' a == word.charAt(0) a word.charAt(0) word.charAt word 0 {
        		a = word.charAt(word.length() - 1);
        		} a = word.charAt(word.length() - 1) a word.charAt(word.length() - 1) word.charAt word word.length() - 1 word.length() word.length word 1 {
        			isRight = false;
        		} isRight = false isRight false String ans = isRight ? "Yes" : "No"; ans isRight ? "Yes" : "No" isRight "Yes" "No" System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int num = Integer.parseInt(in.nextLine());
        List<String> words = new ArrayList<String>();
        boolean isRight = true;
        while(in.hasNextLine()) {
        	String cache = in.nextLine();
            if (words.contains(cache)) {
            	isRight = false;
            	break;
            }
            words.add(cache);
        }
        in.close();
        if (isRight) {
        	char a = ' ';
        	for(String word : words) {
        		if (a == ' ' || a == word.charAt(0)) {
        		a = word.charAt(word.length() - 1);
        		} else {
        			isRight = false;
        		}
        	}
        }
        String ans = isRight ? "Yes" : "No";
        System.out.println(ans);
    }
} public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int num = Integer.parseInt(in.nextLine());
        List<String> words = new ArrayList<String>();
        boolean isRight = true;
        while(in.hasNextLine()) {
        	String cache = in.nextLine();
            if (words.contains(cache)) {
            	isRight = false;
            	break;
            }
            words.add(cache);
        }
        in.close();
        if (isRight) {
        	char a = ' ';
        	for(String word : words) {
        		if (a == ' ' || a == word.charAt(0)) {
        		a = word.charAt(word.length() - 1);
        		} else {
        			isRight = false;
        		}
        	}
        }
        String ans = isRight ? "Yes" : "No";
        System.out.println(ans);
    }
} Main
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int num = Integer.parseInt(in.nextLine());
        List<String> words = new ArrayList<String>();
        boolean isRight = true;
        while(in.hasNextLine()) {
        	String cache = in.nextLine();
            if (words.contains(cache)) {
            	isRight = false;
            	break;
            }
            words.add(cache);
        }
        in.close();
        if (isRight) {
        	char a = ' ';
        	for(String word : words) {
        		if (a == ' ' || a == word.charAt(0)) {
        		a = word.charAt(word.length() - 1);
        		} else {
        			isRight = false;
        		}
        	}
        }
        String ans = isRight ? "Yes" : "No";
        System.out.println(ans);
    }
}