public static void main ( String args [ ] ) {
  Scanner sc = new Scanner ( System . in ) ;
  String n = sc . nextLine ( ) ;
  String s = sc . nextLine ( ) ;
  HashMap < String , String > alpha = new HashMap < String , String > ( ) ;
  long count = 1 ;
  for ( int i = 0 ;
  i < Integer . parseInt ( n ) ;
  i ++ ) {
    char mark = s . charAt ( i ) ;
    if ( alpha . containsKey ( String . valueOf ( mark ) ) ) {
    }
    else {
      alpha . put ( String . valueOf ( mark ) , "" ) ;
      int sum = 0 ;
      for ( int j = i ;
      j < Integer . parseInt ( n ) ;
      j ++ ) {
        if ( s . charAt ( j ) == mark ) {
          sum ++ ;
        }
      }
      count = count % 1000000007 ;
      count *= sum + 1 ;
    }
  }
  System . out . println ( ( count - 1 ) % 1000000007 ) ;
}

public static void main ( String args [ ] ) { Scanner sc = new Scanner ( System . in ) ; String n = sc . nextLine ( ) ; String s = sc . nextLine ( ) ; HashMap < String , String > alpha = new HashMap < String , String > ( ) ; long count = 1 ; for ( int i = 0 ; i < Integer . parseInt ( n ) ; i ++ ) { char mark = s . charAt ( i ) ; if ( alpha . containsKey ( String . valueOf ( mark ) ) ) { } else { alpha . put ( String . valueOf ( mark ) , " " ) ; int sum = 0 ; for ( int j = i ; j < Integer . parseInt ( n ) ; j ++ ) { if ( s . charAt ( j ) == mark ) { sum ++ ; } } count = count % 1000000007 ; count *= sum + 1 ; } } System . out . println ( ( count - 1 ) % 1000000007 ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (type_identifier) name: (identifier) dimensions: (dimensions))) body: (block (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: (type_identifier) declarator: (variable_declarator name: (identifier) value: (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)))) (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: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))) update: (update_expression (identifier)) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))) (if_statement condition: (parenthesized_expression (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))))) consequence: (block) alternative: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) (string_literal)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (identifier))) condition: (binary_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) right: (identifier))) consequence: (block (expression_statement (update_expression (identifier))))))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))))))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (decimal_integer_literal)))))))