A triangular number is the number of dots in an equilateral triangle uniformly filled with dots. For example, three dots can be arranged in a triangle; thus three is a triangular number. The n-th triangular number is the number of dots in a triangle with n dots on a side. <image>. You can learn more about these numbers from Wikipedia (http://en.wikipedia.org/wiki/Triangular_number).

Your task is to find out if a given integer is a triangular number.

Input

The first line contains the single number n (1 ≤ n ≤ 500) — the given integer.

Output

If the given integer is a triangular number output YES, otherwise output NO.

Examples

Input

1


Output

YES


Input

2


Output

NO


Input

3


Output

YES
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.PriorityQueue;
import java.util.Scanner;
import java.util.Set;
import java.util.Stack;
import java.util.Vector;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Main {
	public static void main(String[] args) throws IOException {
		Task task = new Task();
		task.getData();
		task.solve();
		task.printAnswer();
	}
}

class Task {
	int x;

	StringBuilder answer = new StringBuilder();
	// int answer = 0;

	public void getData() throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		//BufferedReader br = new BufferedReader(new FileReader("input.txt"));

		x = Integer.parseInt(br.readLine());

		br.close();
	}

	public void solve() {
		for (int n = 1; n <= x; ++n) {
			if (n * (n + 1) / 2 == x) {
				answer.append("YES");
				return;
			}
			if (n * (n + 1) / 2 > x) {
				break;
			}
		}
		answer.append("NO");
	}

	public void printAnswer() throws IOException {
		System.out.print(answer);
		/*
		BufferedWriter bw = new BufferedWriter(new FileWriter(new
		File("output.txt")));
		bw.append(answer);
		bw.close();
		*/
	}
}

class Pair {
	int first;
	int second;
	
	Pair(int first, int second) {
		this.first = first;
		this.second = second;
	}
}

class Library extends Object {
	public static long binomial(long n, long k) {
		if (k == 0 || n == k) {
			return 1;
		}
		
		return binomial(n - 1, k - 1) + binomial(n - 1, k);
	}
	
	public static ArrayList<ArrayList<Integer>> permutation(int n) {
		ArrayList<ArrayList<Integer>> result = new ArrayList<ArrayList<Integer>>();
		
		if (n == 1) {
			ArrayList<Integer> listToAdd = new ArrayList<Integer>(Arrays.asList(1));
			result.add(listToAdd);
			return result;
		}
		
		ArrayList<ArrayList<Integer>> old = permutation(n - 1);
		
		for (ArrayList<Integer> current : old) {
			for (int position = 0; position < n; ++position) {
				ArrayList<Integer> listToAdd = new ArrayList<Integer>();
				listToAdd.addAll(current.subList(0, position));
				listToAdd.add(n);
				listToAdd.addAll(current.subList(position, current.size()));
				result.add(listToAdd);
			}
		}
		return result;
	}
	
	public static ArrayList<Integer> firstPrimes(int bound) {
		boolean[] isPrime = new boolean[bound + 1];
		Arrays.fill(isPrime, 2, isPrime.length, true);
		for (int i = 2; i <= Math.sqrt(bound); ++i) {
			if (isPrime[i]) {
				for (int j = i * i; j <= bound; j += i) {
					isPrime[j] = false;
				}
			}
		}

		ArrayList<Integer> primes = new ArrayList<Integer>();
		for (int i = 0; i < isPrime.length; ++i) {
			if (isPrime[i]) {
				primes.add(i);
			}
		}
		return primes;
	}
}