public static String getRes ( int [ ] nums ) {
  if ( nums . length == 1 && nums [ 0 ] == 1 ) {
    return "YES" ;
  }
  if ( nums . length == 1 && nums [ 0 ] == 0 ) {
    return "NO" ;
  }
  int res = 0 ;
  for ( int i = 0 ;
  i < nums . length ;
  i ++ ) {
    if ( nums [ i ] == 0 ) {
      res ++ ;
    }
  }
  return res == 1 ? "YES" : "NO" ;
}

public static String getRes ( int [ ] nums ) { if ( nums . length == 1 && nums [ 0 ] == 1 ) { return " YES " ; } if ( nums . length == 1 && nums [ 0 ] == 0 ) { return " NO " ; } int res = 0 ; for ( int i = 0 ; i < nums . length ; i ++ ) { if ( nums [ i ] == 0 ) { res ++ ; } } return res == 1 ? " YES " : " NO " ; }
(method_declaration (modifiers) type: (type_identifier) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (integral_type) dimensions: (dimensions)) name: (identifier))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (field_access object: (identifier) field: (identifier)) right: (decimal_integer_literal)) right: (binary_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (decimal_integer_literal)))) consequence: (block (return_statement (string_literal)))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (field_access object: (identifier) field: (identifier)) right: (decimal_integer_literal)) right: (binary_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (decimal_integer_literal)))) consequence: (block (return_statement (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: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (field_access object: (identifier) field: (identifier))) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (decimal_integer_literal))) consequence: (block (expression_statement (update_expression (identifier))))))) (return_statement (ternary_expression condition: (binary_expression left: (identifier) right: (decimal_integer_literal)) consequence: (string_literal) alternative: (string_literal)))))