public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line = "";
		StringBuilder out = new StringBuilder();
		fillSet();
		d: do {
			line = br.readLine();
			if (line == null || line.length() == 0)
				break d;
			long n = Long.parseLong(line);
			if (set.contains(n))
				out.append("YES").append("\n");
			else
				out.append("NO").append("\n");
		} while (line != null && line.length() != 0);
		System.out.print(out);
	}