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

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		List<String> wordList = new ArrayList<>();

		while (sc.hasNextLine()) {
			wordList.add(sc.nextLine());
		}

		boolean isCorrect = true;
		Set<String> checkHash = new HashSet<>();
		int listSize = wordList.size();
		for (int i = 1 ; i < listSize; i++) {
			String word = wordList.get(i);
			if (i == 0) {
				continue;
			}
			if (i == 1) {
				checkHash.add(word);
				continue;
			}
			if (checkHash.contains(word)) {
				isCorrect = false;
				break;
			}
			String preWord = wordList.get(i-1);
			if (word.charAt(0) != (preWord.charAt(preWord.length()-1))) {
				isCorrect = false;
				break;
			}
			checkHash.add(word);
		}
		if (isCorrect) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}

	}

} import java.util.ArrayList; ArrayList java.util import java.util.HashSet; HashSet java.util import java.util.List; List java.util import java.util.Scanner; Scanner java.util import java.util.Set; Set java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		List<String> wordList = new ArrayList<>();

		while (sc.hasNextLine()) {
			wordList.add(sc.nextLine());
		}

		boolean isCorrect = true;
		Set<String> checkHash = new HashSet<>();
		int listSize = wordList.size();
		for (int i = 1 ; i < listSize; i++) {
			String word = wordList.get(i);
			if (i == 0) {
				continue;
			}
			if (i == 1) {
				checkHash.add(word);
				continue;
			}
			if (checkHash.contains(word)) {
				isCorrect = false;
				break;
			}
			String preWord = wordList.get(i-1);
			if (word.charAt(0) != (preWord.charAt(preWord.length()-1))) {
				isCorrect = false;
				break;
			}
			checkHash.add(word);
		}
		if (isCorrect) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}

	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		List<String> wordList = new ArrayList<>();

		while (sc.hasNextLine()) {
			wordList.add(sc.nextLine());
		}

		boolean isCorrect = true;
		Set<String> checkHash = new HashSet<>();
		int listSize = wordList.size();
		for (int i = 1 ; i < listSize; i++) {
			String word = wordList.get(i);
			if (i == 0) {
				continue;
			}
			if (i == 1) {
				checkHash.add(word);
				continue;
			}
			if (checkHash.contains(word)) {
				isCorrect = false;
				break;
			}
			String preWord = wordList.get(i-1);
			if (word.charAt(0) != (preWord.charAt(preWord.length()-1))) {
				isCorrect = false;
				break;
			}
			checkHash.add(word);
		}
		if (isCorrect) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}

	} main {
		Scanner sc = new Scanner(System.in);
		List<String> wordList = new ArrayList<>();

		while (sc.hasNextLine()) {
			wordList.add(sc.nextLine());
		}

		boolean isCorrect = true;
		Set<String> checkHash = new HashSet<>();
		int listSize = wordList.size();
		for (int i = 1 ; i < listSize; i++) {
			String word = wordList.get(i);
			if (i == 0) {
				continue;
			}
			if (i == 1) {
				checkHash.add(word);
				continue;
			}
			if (checkHash.contains(word)) {
				isCorrect = false;
				break;
			}
			String preWord = wordList.get(i-1);
			if (word.charAt(0) != (preWord.charAt(preWord.length()-1))) {
				isCorrect = false;
				break;
			}
			checkHash.add(word);
		}
		if (isCorrect) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) List<String> wordList = new ArrayList<>(); wordList new ArrayList<>() while (sc.hasNextLine()) {
			wordList.add(sc.nextLine());
		} sc.hasNextLine() sc.hasNextLine sc {
			wordList.add(sc.nextLine());
		} wordList.add(sc.nextLine()) wordList.add wordList sc.nextLine() sc.nextLine sc boolean isCorrect = true; isCorrect true Set<String> checkHash = new HashSet<>(); checkHash new HashSet<>() int listSize = wordList.size(); listSize wordList.size() wordList.size wordList for (int i = 1 ; i < listSize; i++) {
			String word = wordList.get(i);
			if (i == 0) {
				continue;
			}
			if (i == 1) {
				checkHash.add(word);
				continue;
			}
			if (checkHash.contains(word)) {
				isCorrect = false;
				break;
			}
			String preWord = wordList.get(i-1);
			if (word.charAt(0) != (preWord.charAt(preWord.length()-1))) {
				isCorrect = false;
				break;
			}
			checkHash.add(word);
		} int i = 1 ; int i = 1 ; i 1 i < listSize i listSize i++ i++ i {
			String word = wordList.get(i);
			if (i == 0) {
				continue;
			}
			if (i == 1) {
				checkHash.add(word);
				continue;
			}
			if (checkHash.contains(word)) {
				isCorrect = false;
				break;
			}
			String preWord = wordList.get(i-1);
			if (word.charAt(0) != (preWord.charAt(preWord.length()-1))) {
				isCorrect = false;
				break;
			}
			checkHash.add(word);
		} {
			String word = wordList.get(i);
			if (i == 0) {
				continue;
			}
			if (i == 1) {
				checkHash.add(word);
				continue;
			}
			if (checkHash.contains(word)) {
				isCorrect = false;
				break;
			}
			String preWord = wordList.get(i-1);
			if (word.charAt(0) != (preWord.charAt(preWord.length()-1))) {
				isCorrect = false;
				break;
			}
			checkHash.add(word);
		} String word = wordList.get(i); word wordList.get(i) wordList.get wordList i if (i == 0) {
				continue;
			} i == 0 i 0 {
				continue;
			} continue; if (i == 1) {
				checkHash.add(word);
				continue;
			} i == 1 i 1 {
				checkHash.add(word);
				continue;
			} checkHash.add(word) checkHash.add checkHash word continue; if (checkHash.contains(word)) {
				isCorrect = false;
				break;
			} checkHash.contains(word) checkHash.contains checkHash word {
				isCorrect = false;
				break;
			} isCorrect = false isCorrect false break; String preWord = wordList.get(i-1); preWord wordList.get(i-1) wordList.get wordList i-1 i 1 if (word.charAt(0) != (preWord.charAt(preWord.length()-1))) {
				isCorrect = false;
				break;
			} word.charAt(0) != (preWord.charAt(preWord.length()-1)) word.charAt(0) word.charAt word 0 (preWord.charAt(preWord.length()-1)) preWord.charAt preWord preWord.length()-1 preWord.length() preWord.length preWord 1 {
				isCorrect = false;
				break;
			} isCorrect = false isCorrect false break; checkHash.add(word) checkHash.add checkHash word if (isCorrect) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		} isCorrect {
			System.out.println("Yes");
		} System.out.println("Yes") System.out.println System.out System System.out "Yes" {
			System.out.println("No");
		} 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 sc = new Scanner(System.in);
		List<String> wordList = new ArrayList<>();

		while (sc.hasNextLine()) {
			wordList.add(sc.nextLine());
		}

		boolean isCorrect = true;
		Set<String> checkHash = new HashSet<>();
		int listSize = wordList.size();
		for (int i = 1 ; i < listSize; i++) {
			String word = wordList.get(i);
			if (i == 0) {
				continue;
			}
			if (i == 1) {
				checkHash.add(word);
				continue;
			}
			if (checkHash.contains(word)) {
				isCorrect = false;
				break;
			}
			String preWord = wordList.get(i-1);
			if (word.charAt(0) != (preWord.charAt(preWord.length()-1))) {
				isCorrect = false;
				break;
			}
			checkHash.add(word);
		}
		if (isCorrect) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}

	}

} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		List<String> wordList = new ArrayList<>();

		while (sc.hasNextLine()) {
			wordList.add(sc.nextLine());
		}

		boolean isCorrect = true;
		Set<String> checkHash = new HashSet<>();
		int listSize = wordList.size();
		for (int i = 1 ; i < listSize; i++) {
			String word = wordList.get(i);
			if (i == 0) {
				continue;
			}
			if (i == 1) {
				checkHash.add(word);
				continue;
			}
			if (checkHash.contains(word)) {
				isCorrect = false;
				break;
			}
			String preWord = wordList.get(i-1);
			if (word.charAt(0) != (preWord.charAt(preWord.length()-1))) {
				isCorrect = false;
				break;
			}
			checkHash.add(word);
		}
		if (isCorrect) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}

	}

} Main
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Scanner;
import java.util.Set;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		List<String> wordList = new ArrayList<>();

		while (sc.hasNextLine()) {
			wordList.add(sc.nextLine());
		}

		boolean isCorrect = true;
		Set<String> checkHash = new HashSet<>();
		int listSize = wordList.size();
		for (int i = 1 ; i < listSize; i++) {
			String word = wordList.get(i);
			if (i == 0) {
				continue;
			}
			if (i == 1) {
				checkHash.add(word);
				continue;
			}
			if (checkHash.contains(word)) {
				isCorrect = false;
				break;
			}
			String preWord = wordList.get(i-1);
			if (word.charAt(0) != (preWord.charAt(preWord.length()-1))) {
				isCorrect = false;
				break;
			}
			checkHash.add(word);
		}
		if (isCorrect) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}

	}

}
