Language: C++

import java.lang.*;
import java.io.*;
import java.util.*;


public class Main {
	
	public static void main(String[] args) throws java.lang.Exception {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskA solver = new TaskA();
		solver.solve(in, out);
		out.close();
	}
}

class TaskA {
	
	public void solve(InputReader in, PrintWriter out) {
		int[] a = new int[3];
		
		for (int i=0; i<3; ++i)
			a[i] = in.nextInt();
		Arrays.sort(a);
		
		if (a[1]-a[0] == a[2]-a[1])
			out.println("YES");
		else
			out.println("NO");
	}
}

class InputReader {
	public BufferedReader reader;
	public StringTokenizer tokenizer;
	
	public InputReader(InputStream stream) {
		reader = new BufferedReader(new InputStreamReader(stream), 32768);
		tokenizer = null;
	}
	
	public String next() {
		while (tokenizer==null || !tokenizer.hasMoreTokens()) {
			try {
				tokenizer = new StringTokenizer(reader.readLine());
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken();
	}
	
	public int nextInt() {
		return Integer.parseInt(next());
	}
} 

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.lang.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import java.io.*;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
    3 | import java.util.*;
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:6:1: error: expected unqualified-id before 'public'
    6 | public class Main {
      | ^~~~~~
a.cc:21:15: error: expected ':' before 'void'
   21 |         public void solve(InputReader in, PrintWriter out) {
      |               ^~~~~
      |               :
a.cc:21:27: error: 'InputReader' has not been declared
   21 |         public void solve(InputReader in, PrintWriter out) {
      |                           ^~~~~~~~~~~
a.cc:21:43: error: 'PrintWriter' has not been declared
   21 |         public void solve(InputReader in, PrintWriter out) {
      |                                           ^~~~~~~~~~~
a.cc:33:2: error: expected ';' after class definition
   33 | }
      |  ^
      |  ;
a.cc: In member function 'void TaskA::solve(int, int)':
a.cc:22:20: error: structured binding declaration cannot have type 'int'
   22 |                 int[] a = new int[3];
      |                    ^~
a.cc:22:20: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:22:20: error: empty structured binding declaration
a.cc:22:23: error: expected initializer before 'a'
   22 |                 int[] a = new int[3];
      |                       ^
a.cc:25:25: error: 'a' was not declared in this scope
   25 |                         a[i] = in.nextInt();
      |                         ^
a.cc:25:35: error: request for member 'nextInt' in 'in', which is of non-class type 'int'
   25 |                         a[i] = in.nextInt();
      |                                   ^~~~~~~
a.cc:26:17: error: 'Arrays' was not declared in this scope
   26 |                 Arrays.sort(a);
      |                 ^~~~~~
a.cc:26:29: error: 'a' was not declared in this scope
   26 |                 Arrays.sort(a);
      |                             ^
a.cc:29:29: error: request for member 'println' in 'out', which is of non-class type 'int'
   29 |                         out.println("YES");
      |                             ^~~~~~~
a.cc:31:29: error: request for member 'println' in 'out', which is of non-class type 'int'
   31 |                         out.println("NO");
      |                             ^~~~~~~
a.cc: At global scope:
a.cc:36:15: error: expected ':' before 'BufferedReader'
   36 |         public BufferedReader reader;
      |               ^~~~~~~~~~~~~~~
      |               :
a.cc:36:16: error: 'BufferedReader' does not name a type
   36 |         public BufferedReader reader;
      |                ^~~~~~~~~~~~~~
a.cc:37:15: error: expected ':' before 'StringTokenizer'
   37 |         public StringTokenizer tokenizer;
      |               ^~~~~~~~~~~~~~~~
      |               :
a.cc:37:16: error: 'StringTokenizer' does not name a type
   37 |         public StringTokenizer tokenizer;
      |                ^~~~~~~~~~~~~~~
a.cc:39:15: error: expected ':' before 'InputReader'
   39 |         public InputReader(InputStream stream) {
      |               ^~~~~~~~~~~~
      |               :
a.cc:39:39: error: expected ')' before 'stream'
   39 |         public InputReader(InputStream stream) {
      |                           ~           ^~~~~~~
      |                                       )
a.cc:44:15: error: expected ':' before 'String'
   44 |         public String next() {
      |               ^~~~~~~
      |               :
a.cc:44:16: error: 'String' does not name a type
   44 |         public String next() {
      |                ^~~~~~
a.cc:55:15: error: expected ':' before 'int'
   55 |         public int nextInt() {
      |               ^~~~
      |               :
a.cc:58:2: error: expected ';' after class definition
   58 | }
      |  ^
      |  ;
a.cc: In member function 'int InputReader::nextInt()':
a.cc:56:24: error: 'Integer' was not declared in this scope
   56 |                 return Integer.parseInt(next());
      |                        ^~~~~~~
a.cc:56:41: error: 'next' was not declared in this scope; did you mean 'nextInt'?
   56 |                 return Integer.parseInt(next());
      |                                         ^~~~
      |                                         nextInt