public static void main ( String args [ ] ) throws IOException {
  BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ;
  String line = br . readLine ( ) ;
  String text [ ] = line . split ( " " ) ;
  int N , A ;
  N = Integer . parseInt ( text [ 0 ] ) ;
  A = Integer . parseInt ( text [ 1 ] ) ;
  line = br . readLine ( ) ;
  text = line . split ( " " ) ;
  int [ ] x = new int [ N ] ;
  for ( int i = 0 ;
  i < N ;
  i ++ ) {
    x [ i ] = Integer . parseInt ( text [ i ] ) - A ;
  }
  long dp [ ] [ ] = new long [ N ] [ N * 50 * 2 + 1 ] ;
  int dpl = 50 * N ;
  dp [ 0 ] [ x [ 0 ] + dpl ] = 1 ;
  for ( int j = 1 ;
  j < N ;
  j ++ ) {
    for ( int k = - 1 * N * 50 ;
    k < N * 50 + 1 ;
    k ++ ) {
      if ( k + dpl - x [ j ] >= 0 && k + dpl - x [ j ] <= 50 * N * 2 ) {
        dp [ j ] [ k + dpl ] = dp [ j - 1 ] [ k + dpl ] + dp [ j - 1 ] [ k + dpl - x [ j ] ] ;
      }
      else {
        dp [ j ] [ k + dpl ] = dp [ j - 1 ] [ k + dpl ] ;
      }
      if ( x [ j ] == k ) dp [ j ] [ k + dpl ] ++ ;
    }
  }
  System . out . println ( dp [ N - 1 ] [ dpl ] ) ;
}

public static void main ( String args [ ] ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String line = br . readLine ( ) ; String text [ ] = line . split ( " ▁ " ) ; int N , A ; N = Integer . parseInt ( text [ 0 ] ) ; A = Integer . parseInt ( text [ 1 ] ) ; line = br . readLine ( ) ; text = line . split ( " ▁ " ) ; int [ ] x = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { x [ i ] = Integer . parseInt ( text [ i ] ) - A ; } long dp [ ] [ ] = new long [ N ] [ N * 50 * 2 + 1 ] ; int dpl = 50 * N ; dp [ 0 ] [ x [ 0 ] + dpl ] = 1 ; for ( int j = 1 ; j < N ; j ++ ) { for ( int k = - 1 * N * 50 ; k < N * 50 + 1 ; k ++ ) { if ( k + dpl - x [ j ] >= 0 && k + dpl - x [ j ] <= 50 * N * 2 ) { dp [ j ] [ k + dpl ] = dp [ j - 1 ] [ k + dpl ] + dp [ j - 1 ] [ k + dpl - x [ j ] ] ; } else { dp [ j ] [ k + dpl ] = dp [ j - 1 ] [ k + dpl ] ; } if ( x [ j ] == k ) dp [ j ] [ k + dpl ] ++ ; } } System . out . println ( dp [ N - 1 ] [ dpl ] ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (type_identifier) name: (identifier) dimensions: (dimensions))) (throws (type_identifier)) body: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list (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) dimensions: (dimensions) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (string_literal))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier)) declarator: (variable_declarator name: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (array_access array: (identifier) index: (decimal_integer_literal)))))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (array_access array: (identifier) index: (decimal_integer_literal)))))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (string_literal))))) (local_variable_declaration type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (identifier))))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (array_access array: (identifier) index: (identifier)))) right: (identifier)))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) dimensions: (dimensions) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (identifier)) dimensions: (dimensions_expr (binary_expression left: (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (decimal_integer_literal)) right: (decimal_integer_literal)))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (decimal_integer_literal) right: (identifier)))) (expression_statement (assignment_expression left: (array_access array: (array_access array: (identifier) index: (decimal_integer_literal)) index: (binary_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (identifier))) right: (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: (identifier)) update: (update_expression (identifier)) body: (block (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (binary_expression left: (unary_expression operand: (decimal_integer_literal)) right: (identifier)) right: (decimal_integer_literal)))) condition: (binary_expression left: (identifier) right: (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (decimal_integer_literal))) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (array_access array: (identifier) index: (identifier))) right: (decimal_integer_literal)) right: (binary_expression left: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (array_access array: (identifier) index: (identifier))) right: (binary_expression left: (binary_expression left: (decimal_integer_literal) right: (identifier)) right: (decimal_integer_literal))))) consequence: (block (expression_statement (assignment_expression left: (array_access array: (array_access array: (identifier) index: (identifier)) index: (binary_expression left: (identifier) right: (identifier))) right: (binary_expression left: (array_access array: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) index: (binary_expression left: (identifier) right: (identifier))) right: (array_access array: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) index: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (array_access array: (identifier) index: (identifier)))))))) alternative: (block (expression_statement (assignment_expression left: (array_access array: (array_access array: (identifier) index: (identifier)) index: (binary_expression left: (identifier) right: (identifier))) right: (array_access array: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) index: (binary_expression left: (identifier) right: (identifier))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (identifier))) consequence: (expression_statement (update_expression (array_access array: (array_access array: (identifier) index: (identifier)) index: (binary_expression left: (identifier) right: (identifier)))))))))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (array_access array: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) index: (identifier)))))))