static String help ( int n , long [ ] A ) {
  if ( n == 1 ) return "YES" ;
  long sum = A [ 1 ] ;
  for ( int i = 2 ;
  i <= n ;
  i ++ ) sum += A [ i ] ;
  long temp = ( ( long ) n ) * ( ( long ) n + 1 ) / 2 ;
  if ( sum % temp != 0 ) return "NO" ;
  long K = sum / temp ;
  long [ ] x = new long [ n + 1 ] ;
  long sumx = 0 ;
  for ( int i = 1 ;
  i <= n ;
  i ++ ) {
    long dif = i == n ? ( A [ 1 ] - A [ i ] ) : ( A [ i + 1 ] - A [ i ] ) ;
    if ( K == dif ) continue ;
    if ( ( K - dif ) % n != 0 || K < dif ) return "NO" ;
    x [ i ] = ( K - dif ) / n ;
    sumx += x [ i ] ;
  }
  if ( sumx != K ) return "NO" ;
  else return "YES" ;
}

static String help ( int n , long [ ] A ) { if ( n == 1 ) return " YES " ; long sum = A [ 1 ] ; for ( int i = 2 ; i <= n ; i ++ ) sum += A [ i ] ; long temp = ( ( long ) n ) * ( ( long ) n + 1 ) / 2 ; if ( sum % temp != 0 ) return " NO " ; long K = sum / temp ; long [ ] x = new long [ n + 1 ] ; long sumx = 0 ; for ( int i = 1 ; i <= n ; i ++ ) { long dif = i == n ? ( A [ 1 ] - A [ i ] ) : ( A [ i + 1 ] - A [ i ] ) ; if ( K == dif ) continue ; if ( ( K - dif ) % n != 0 || K < dif ) return " NO " ; x [ i ] = ( K - dif ) / n ; sumx += x [ i ] ; } if ( sumx != K ) return " NO " ; else return " YES " ; }
(method_declaration (modifiers) type: (type_identifier) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (array_type element: (integral_type) dimensions: (dimensions)) name: (identifier))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (return_statement (string_literal))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (array_access array: (identifier) index: (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: (expression_statement (assignment_expression left: (identifier) right: (array_access array: (identifier) index: (identifier))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (binary_expression left: (parenthesized_expression (cast_expression type: (integral_type) value: (identifier))) right: (parenthesized_expression (binary_expression left: (cast_expression type: (integral_type) value: (identifier)) right: (decimal_integer_literal)))) right: (decimal_integer_literal)))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (decimal_integer_literal))) consequence: (return_statement (string_literal))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (identifier)))) (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 (binary_expression left: (identifier) right: (decimal_integer_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: (identifier)) update: (update_expression (identifier)) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (ternary_expression condition: (binary_expression left: (identifier) right: (identifier)) consequence: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (array_access array: (identifier) index: (identifier)))) alternative: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (array_access array: (identifier) index: (identifier))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (continue_statement)) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) right: (identifier)) right: (decimal_integer_literal)) right: (binary_expression left: (identifier) right: (identifier)))) consequence: (return_statement (string_literal))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) right: (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (array_access array: (identifier) index: (identifier)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (return_statement (string_literal)) alternative: (return_statement (string_literal)))))