static boolean modularSum ( int arr [ ] , int n , int m ) {
  if ( n > m ) return true ;
  boolean DP [ ] = new boolean [ m ] ;
  Arrays . fill ( DP , false ) ;
  for ( int i = 0 ;
  i < n ;
  i ++ ) {
    if ( DP [ 0 ] ) return true ;
    boolean temp [ ] = new boolean [ m ] ;
    Arrays . fill ( temp , false ) ;
    for ( int j = 0 ;
    j < m ;
    j ++ ) {
      if ( DP [ j ] == true ) {
        if ( DP [ ( j + arr [ i ] ) % m ] == false ) temp [ ( j + arr [ i ] ) % m ] = true ;
      }
    }
    for ( int j = 0 ;
    j < m ;
    j ++ ) if ( temp [ j ] ) DP [ j ] = true ;
    DP [ arr [ i ] % m ] = true ;
  }
  return DP [ 0 ] ;
}

static boolean modularSum ( int arr [ ] , int n , int m ) { if ( n > m ) return true ; boolean DP [ ] = new boolean [ m ] ; Arrays . fill ( DP , false ) ; for ( int i = 0 ; i < n ; i ++ ) { if ( DP [ 0 ] ) return true ; boolean temp [ ] = new boolean [ m ] ; Arrays . fill ( temp , false ) ; for ( int j = 0 ; j < m ; j ++ ) { if ( DP [ j ] == true ) { if ( DP [ ( j + arr [ i ] ) % m ] == false ) temp [ ( j + arr [ i ] ) % m ] = true ; } } for ( int j = 0 ; j < m ; j ++ ) if ( temp [ j ] ) DP [ j ] = true ; DP [ arr [ i ] % m ] = true ; } return DP [ 0 ] ; }
(method_declaration (modifiers) type: (boolean_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier) dimensions: (dimensions)) (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (return_statement (true))) (local_variable_declaration type: (boolean_type) declarator: (variable_declarator name: (identifier) dimensions: (dimensions) value: (array_creation_expression type: (boolean_type) dimensions: (dimensions_expr (identifier))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (false)))) (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 (if_statement condition: (parenthesized_expression (array_access array: (identifier) index: (decimal_integer_literal))) consequence: (return_statement (true))) (local_variable_declaration type: (boolean_type) declarator: (variable_declarator name: (identifier) dimensions: (dimensions) value: (array_creation_expression type: (boolean_type) dimensions: (dimensions_expr (identifier))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (false)))) (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 (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (true))) consequence: (block (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (array_access array: (identifier) index: (identifier)))) right: (identifier))) right: (false))) consequence: (expression_statement (assignment_expression left: (array_access array: (identifier) index: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (array_access array: (identifier) index: (identifier)))) right: (identifier))) right: (true)))))))) (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: (if_statement condition: (parenthesized_expression (array_access array: (identifier) index: (identifier))) consequence: (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (true))))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (identifier))) right: (true))))) (return_statement (array_access array: (identifier) index: (decimal_integer_literal)))))