public static void main ( String [ ] args ) throws Exception {
  Map < String , Integer > po = new HashMap < String , Integer > ( ) ;
  Scanner sc = new Scanner ( System . in ) ;
  int n = sc . nextInt ( ) ;
  boolean ppp = true ;
  sc . nextLine ( ) ;
  String g = sc . nextLine ( ) ;
  po . put ( g , 0 ) ;
  String nstr = g . substring ( g . length ( ) - 1 , g . length ( ) ) ;
  for ( int i = 0 ;
  i < n - 1 ;
  i ++ ) {
    String str = sc . nextLine ( ) ;
    if ( po . containsKey ( str ) ) {
      ppp = false ;
      break ;
    }
    else {
      if ( nstr . equals ( str . substring ( 0 , 1 ) ) ) {
        nstr = str . substring ( str . length ( ) - 1 , str . length ( ) ) ;
        po . put ( str , 0 ) ;
      }
      else {
        ppp = false ;
        break ;
      }
    }
  }
  System . out . println ( ( ppp ) ? "Yes" : "No" ) ;
}

public static void main ( String [ ] args ) throws Exception { Map < String , Integer > po = new HashMap < String , Integer > ( ) ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; boolean ppp = true ; sc . nextLine ( ) ; String g = sc . nextLine ( ) ; po . put ( g , 0 ) ; String nstr = g . substring ( g . length ( ) - 1 , g . length ( ) ) ; for ( int i = 0 ; i < n - 1 ; i ++ ) { String str = sc . nextLine ( ) ; if ( po . containsKey ( str ) ) { ppp = false ; break ; } else { if ( nstr . equals ( str . substring ( 0 , 1 ) ) ) { nstr = str . substring ( str . length ( ) - 1 , str . length ( ) ) ; po . put ( str , 0 ) ; } else { ppp = false ; break ; } } } System . out . println ( ( ppp ) ? " Yes " : " No " ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) (throws (type_identifier)) body: (block (local_variable_declaration type: (generic_type (type_identifier) (type_arguments (type_identifier) (type_identifier))) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (generic_type (type_identifier) (type_arguments (type_identifier) (type_identifier))) arguments: (argument_list)))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list (field_access object: (identifier) field: (identifier)))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (boolean_type) declarator: (variable_declarator name: (identifier) value: (true))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (decimal_integer_literal)))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) right: (decimal_integer_literal)) (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (binary_expression left: (identifier) right: (decimal_integer_literal))) update: (update_expression (identifier)) body: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (if_statement condition: (parenthesized_expression (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (false))) (break_statement)) alternative: (block (if_statement condition: (parenthesized_expression (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal) (decimal_integer_literal)))))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) right: (decimal_integer_literal)) (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (decimal_integer_literal))))) alternative: (block (expression_statement (assignment_expression left: (identifier) right: (false))) (break_statement))))))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (ternary_expression condition: (parenthesized_expression (identifier)) consequence: (string_literal) alternative: (string_literal)))))))