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
/*==============================================
Name        : Shadman Shariar                 ||
Email       : shadman.shariar@northsouth.edu  ||
University  : North South University (NSU)    ||
Facebook    : shadman.shahriar.007            ||
==============================================*/
//import java.io.*;
import java.util.*;
//import java.math.BigInteger;
//import java.text.DecimalFormat;

public class Main {

public static Main obj = new Main();
public static Scanner input = new Scanner (System.in);
//public static DecimalFormat df = new DecimalFormat(".00");

public static void main(String[] args) throws Exception {
Scanner input = new Scanner (System.in);
//BigInteger bi1 = new BigInteger("0");	
//StringBuilder sb = new StringBuilder();
    
int [] arr = {0, 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 66, 78, 91, 105, 120, 136, 153, 171, 190, 210, 231, 253, 276, 300, 325, 351, 378, 406, 435, 465, 496};  
     boolean bo = false;
     int n = input.nextInt();
     for (int i = 0; i < arr.length; i++) {
		if (arr[i]==n) {
			bo = true;
			break;
		}
	}
       if(bo)System.out.println("YES");
       else System.out.println("NO");
        input.close();
		System.exit(0);
}
public static boolean square(long x)
{
    if (x >= 0) {
        double sr = Math.sqrt(x);
        return ((sr * sr) == x);
    }
    return false;
}
public static boolean cube(long N)
{
    int cube; int c = 0;
    for (int i = 0; i <= N; i++) {
        cube = i * i * i;
        if (cube == N) {
           
            c=1; break;
        }
        else if (cube > N) {
          
           c=0 ; break ;
        }
    }
	if (c==1)return true;
	else return false;
}

public static boolean checkleapyear(int year)
{
    if (year % 400 == 0)
        return true;
    if (year % 100 == 0)
        return false;
    if (year % 4 == 0)
        return true;
    return false;
}

public static boolean[] sieveOfEratosthenes(int n)
{
    boolean prime[] = new boolean[n + 1];
    for (int i = 0; i <= n; i++)
        prime[i] = true;

    for (int p = 2; p * p <= n; p++)
    {
        if (prime[p] == true)
        {
            for (int i = p * p; i <= n; i += p)
                prime[i] = false;
        }
    }
    prime[1]=false;
    return prime;
}

public static boolean issquare(long n) {
	long sqrt=(long) Math.sqrt(n);
	for (int i=(int) Math.max(1, sqrt-5); i<=sqrt+5; i++)
		if (i*i==n)
			return true;
	return false;
}

	public static long sumarray(long a[])
	 {
		
	    long sum=0;
	    for(int i=0;i<a.length;i++)
	    sum+=a[i];
	    return sum;
	 }
	
	public static boolean isperfectsquare(long n) {
        for (long i = 1; i * i <= n; i++) {
 
            if ((n % i == 0) && (n / i == i)) {
                return true;
            }
        }
        return false;
    }
	
	public static int removeduplicateelements(int arr[], int n){ 
		Arrays.sort(arr);
        if (n==0 || n==1){  
            return n;  
        }  
        int[] temp = new int[n];  
        int j = 0;  
        for (int i=0; i<n-1; i++){  
            if (arr[i] != arr[i+1]){  
                temp[j++] = arr[i];  
            }  
         }  
        temp[j++] = arr[n-1];      
        for (int i=0; i<j; i++){  
            arr[i] = temp[i];  
        }  
        return j;  
    }  
	
	public static int fibon(int n) {

		if (n <= 1) {

			return n;
		}
		int[] array = new int[n + 1];
		array[0] = 0;
		array[1] = 1;
		for (int i = 2; i <= n; i++) {
			array[i] = array[i - 2] + array[i - 1];
		}

		return array[n];

	}

	public static long sumofdigits(long n) {
		long sum = 0;

		while (n != 0) {
			sum = sum + n % 10;
			n = n / 10;
		}

		return sum;
	}

	public static int reversedigits(int num) {
		int rev_num = 0;
		while (num > 0) {
			rev_num = rev_num * 10 + num % 10;
			num = num / 10;
		}
		return rev_num;
	}

	public static int binarysearch(int arr[], int l, int r, int x) {

		if (r >= l) {
			int mid = l + (r - l) / 2;
			if (arr[mid] == x)
				return mid;
			if (arr[mid] > x)
				return binarysearch(arr, l, mid - 1, x);
			return binarysearch(arr, mid + 1, r, x);
		}
		return -1;
	}

	public static long gcd(long a, long b) {
		if (a == 0)
			return b;
		return gcd(b % a, a);
	}

	public static long lcm(long a, long b) {
		return (a / gcd(a, b)) * b;
	}

	public static void rangeofprimenumber(int a, int b) {
		int i, j, flag;
		for (i = a; i <= b; i++) {
			if (i == 1 || i == 0)
				continue;
			flag = 1;
			for (j = 2; j <= i / 2; ++j) {
				if (i % j == 0) {
					flag = 0;
					break;
				}
			}
			if (flag == 1)
				System.out.println(i);
		}
	}

	public static boolean isprime(long n) {
		if (n <= 1)
			return false;
		else if (n == 2)
			return true;
		else if (n % 2 == 0)
			return false;
		for (long i = 3; i <= Math.sqrt(n); i += 2) {
			if (n % i == 0)
				return false;
		}
		return true;
	}

	public static int factorial(int n) {
		return (n == 1 || n == 0) ? 1 : n * factorial(n - 1);
	}

	public static int[] reversearrayinrange(int arr[], int start, int end) {
		int temp;

		while (start < end) {
			temp = arr[start];
			arr[start] = arr[end];
			arr[end] = temp;
			start++;
			end--;
		}
		return arr;
	}

}