public static void main ( String [ ] args ) throws IOException {
  int [ ] p = readArray ( ) ;
  int a = p [ 0 ] ;
  int b = p [ 1 ] ;
  int c = p [ 2 ] ;
  if ( c == 0 ) {
    out . print ( a == b ? "YES" : "NO" ) ;
  }
  else if ( c > 0 ) {
    if ( b < a ) {
      out . print ( "NO" ) ;
    }
    else {
      out . print ( ( b - a ) % c == 0 ? "YES" : "NO" ) ;
    }
  }
  else if ( c < 0 ) {
    if ( b > a ) {
      out . print ( "NO" ) ;
    }
    else {
      out . print ( ( b - a ) % c == 0 ? "YES" : "NO" ) ;
    }
  }
  out . close ( ) ;
}

public static void main ( String [ ] args ) throws IOException { int [ ] p = readArray ( ) ; int a = p [ 0 ] ; int b = p [ 1 ] ; int c = p [ 2 ] ; if ( c == 0 ) { out . print ( a == b ? " YES " : " NO " ) ; } else if ( c > 0 ) { if ( b < a ) { out . print ( " NO " ) ; } else { out . print ( ( b - a ) % c == 0 ? " YES " : " NO " ) ; } } else if ( c < 0 ) { if ( b > a ) { out . print ( " NO " ) ; } else { out . print ( ( b - a ) % c == 0 ? " YES " : " NO " ) ; } } out . close ( ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) (throws (type_identifier)) body: (block (local_variable_declaration type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (method_invocation name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (array_access array: (identifier) index: (decimal_integer_literal)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (array_access array: (identifier) index: (decimal_integer_literal)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (array_access array: (identifier) index: (decimal_integer_literal)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (ternary_expression condition: (binary_expression left: (identifier) right: (identifier)) consequence: (string_literal) alternative: (string_literal)))))) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (string_literal))))) alternative: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (ternary_expression condition: (binary_expression left: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) right: (identifier)) right: (decimal_integer_literal)) consequence: (string_literal) alternative: (string_literal)))))))) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (string_literal))))) alternative: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (ternary_expression condition: (binary_expression left: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) right: (identifier)) right: (decimal_integer_literal)) consequence: (string_literal) alternative: (string_literal))))))))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))