import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;

public class Main {

  public static void main(String[] args) throws Exception {
    try (BufferedReader reader = new BufferedReader(new InputStreamReader(System.in))) {
      System.out.println(validate(reader.lines().iterator()) ? "Yes" : "No");
    }
  }

  private static boolean validate(Iterator<String> lines) {
    int count = Integer.parseInt(lines.next());
    // ほんとうはこんなコード書きたくない
    int lastChar = -1;
    Set<String> remember = new HashSet<>();
    for (; count != 0; --count) {
      final String line = lines.next();
      if (line == null) return false;
      if (remember.contains(line))
        return false;
      remember.add(line);
      final int length = line.length();
      if (lastChar != -1) {
        if (length == 0 || line.charAt(0) != lastChar) { return false; }
      }
      lastChar = line.charAt(length - 1);
    }
    return true;
  }

} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.HashSet; HashSet java.util import java.util.Iterator; Iterator java.util import java.util.Set; Set java.util public class Main {

  public static void main(String[] args) throws Exception {
    try (BufferedReader reader = new BufferedReader(new InputStreamReader(System.in))) {
      System.out.println(validate(reader.lines().iterator()) ? "Yes" : "No");
    }
  }

  private static boolean validate(Iterator<String> lines) {
    int count = Integer.parseInt(lines.next());
    // ほんとうはこんなコード書きたくない
    int lastChar = -1;
    Set<String> remember = new HashSet<>();
    for (; count != 0; --count) {
      final String line = lines.next();
      if (line == null) return false;
      if (remember.contains(line))
        return false;
      remember.add(line);
      final int length = line.length();
      if (lastChar != -1) {
        if (length == 0 || line.charAt(0) != lastChar) { return false; }
      }
      lastChar = line.charAt(length - 1);
    }
    return true;
  }

} Main public static void main(String[] args) throws Exception {
    try (BufferedReader reader = new BufferedReader(new InputStreamReader(System.in))) {
      System.out.println(validate(reader.lines().iterator()) ? "Yes" : "No");
    }
  } main {
    try (BufferedReader reader = new BufferedReader(new InputStreamReader(System.in))) {
      System.out.println(validate(reader.lines().iterator()) ? "Yes" : "No");
    }
  } try (BufferedReader reader = new BufferedReader(new InputStreamReader(System.in))) {
      System.out.println(validate(reader.lines().iterator()) ? "Yes" : "No");
    } {
      System.out.println(validate(reader.lines().iterator()) ? "Yes" : "No");
    } BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)) BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)) new BufferedReader(new InputStreamReader(System.in)) System.out.println(validate(reader.lines().iterator()) ? "Yes" : "No") System.out.println System.out System System.out validate(reader.lines().iterator()) ? "Yes" : "No" validate(reader.lines().iterator()) validate reader.lines().iterator() reader.lines().iterator reader.lines() reader.lines reader "Yes" "No" String[] args args private static boolean validate(Iterator<String> lines) {
    int count = Integer.parseInt(lines.next());
    // ほんとうはこんなコード書きたくない
    int lastChar = -1;
    Set<String> remember = new HashSet<>();
    for (; count != 0; --count) {
      final String line = lines.next();
      if (line == null) return false;
      if (remember.contains(line))
        return false;
      remember.add(line);
      final int length = line.length();
      if (lastChar != -1) {
        if (length == 0 || line.charAt(0) != lastChar) { return false; }
      }
      lastChar = line.charAt(length - 1);
    }
    return true;
  } validate {
    int count = Integer.parseInt(lines.next());
    // ほんとうはこんなコード書きたくない
    int lastChar = -1;
    Set<String> remember = new HashSet<>();
    for (; count != 0; --count) {
      final String line = lines.next();
      if (line == null) return false;
      if (remember.contains(line))
        return false;
      remember.add(line);
      final int length = line.length();
      if (lastChar != -1) {
        if (length == 0 || line.charAt(0) != lastChar) { return false; }
      }
      lastChar = line.charAt(length - 1);
    }
    return true;
  } int count = Integer.parseInt(lines.next()); count Integer.parseInt(lines.next()) Integer.parseInt Integer lines.next() lines.next lines int lastChar = -1; lastChar -1 1 Set<String> remember = new HashSet<>(); remember new HashSet<>() for (; count != 0; --count) {
      final String line = lines.next();
      if (line == null) return false;
      if (remember.contains(line))
        return false;
      remember.add(line);
      final int length = line.length();
      if (lastChar != -1) {
        if (length == 0 || line.charAt(0) != lastChar) { return false; }
      }
      lastChar = line.charAt(length - 1);
    } ; count != 0 count 0 --count --count count {
      final String line = lines.next();
      if (line == null) return false;
      if (remember.contains(line))
        return false;
      remember.add(line);
      final int length = line.length();
      if (lastChar != -1) {
        if (length == 0 || line.charAt(0) != lastChar) { return false; }
      }
      lastChar = line.charAt(length - 1);
    } {
      final String line = lines.next();
      if (line == null) return false;
      if (remember.contains(line))
        return false;
      remember.add(line);
      final int length = line.length();
      if (lastChar != -1) {
        if (length == 0 || line.charAt(0) != lastChar) { return false; }
      }
      lastChar = line.charAt(length - 1);
    } final String line = lines.next(); line lines.next() lines.next lines if (line == null) return false; line == null line null return false; false if (remember.contains(line))
        return false; remember.contains(line) remember.contains remember line return false; false remember.add(line) remember.add remember line final int length = line.length(); length line.length() line.length line if (lastChar != -1) {
        if (length == 0 || line.charAt(0) != lastChar) { return false; }
      } lastChar != -1 lastChar -1 1 {
        if (length == 0 || line.charAt(0) != lastChar) { return false; }
      } if (length == 0 || line.charAt(0) != lastChar) { return false; } length == 0 || line.charAt(0) != lastChar length == 0 length 0 line.charAt(0) != lastChar line.charAt(0) line.charAt line 0 lastChar { return false; } return false; false lastChar = line.charAt(length - 1) lastChar line.charAt(length - 1) line.charAt line length - 1 length 1 return true; true Iterator<String> lines lines public class Main {

  public static void main(String[] args) throws Exception {
    try (BufferedReader reader = new BufferedReader(new InputStreamReader(System.in))) {
      System.out.println(validate(reader.lines().iterator()) ? "Yes" : "No");
    }
  }

  private static boolean validate(Iterator<String> lines) {
    int count = Integer.parseInt(lines.next());
    // ほんとうはこんなコード書きたくない
    int lastChar = -1;
    Set<String> remember = new HashSet<>();
    for (; count != 0; --count) {
      final String line = lines.next();
      if (line == null) return false;
      if (remember.contains(line))
        return false;
      remember.add(line);
      final int length = line.length();
      if (lastChar != -1) {
        if (length == 0 || line.charAt(0) != lastChar) { return false; }
      }
      lastChar = line.charAt(length - 1);
    }
    return true;
  }

} public class Main {

  public static void main(String[] args) throws Exception {
    try (BufferedReader reader = new BufferedReader(new InputStreamReader(System.in))) {
      System.out.println(validate(reader.lines().iterator()) ? "Yes" : "No");
    }
  }

  private static boolean validate(Iterator<String> lines) {
    int count = Integer.parseInt(lines.next());
    // ほんとうはこんなコード書きたくない
    int lastChar = -1;
    Set<String> remember = new HashSet<>();
    for (; count != 0; --count) {
      final String line = lines.next();
      if (line == null) return false;
      if (remember.contains(line))
        return false;
      remember.add(line);
      final int length = line.length();
      if (lastChar != -1) {
        if (length == 0 || line.charAt(0) != lastChar) { return false; }
      }
      lastChar = line.charAt(length - 1);
    }
    return true;
  }

} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;

public class Main {

  public static void main(String[] args) throws Exception {
    try (BufferedReader reader = new BufferedReader(new InputStreamReader(System.in))) {
      System.out.println(validate(reader.lines().iterator()) ? "Yes" : "No");
    }
  }

  private static boolean validate(Iterator<String> lines) {
    int count = Integer.parseInt(lines.next());
    // ほんとうはこんなコード書きたくない
    int lastChar = -1;
    Set<String> remember = new HashSet<>();
    for (; count != 0; --count) {
      final String line = lines.next();
      if (line == null) return false;
      if (remember.contains(line))
        return false;
      remember.add(line);
      final int length = line.length();
      if (lastChar != -1) {
        if (length == 0 || line.charAt(0) != lastChar) { return false; }
      }
      lastChar = line.charAt(length - 1);
    }
    return true;
  }

}
