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
#n,k = [int(i) for i in raw_input().split()]
n = int(raw_input())
import math
def is_prime(x):
    for i in xrange(2,int(math.sqrt(x)+1)):
        if (x % i == 0): return False
    return True

#lst = []
#for i in xrange(2,n+1):
    #if (is_prime(i)): lst.append(i)
##print lst
#ans = 0
#for i in xrange(1,n+1):
    #c = 0
    #for j in lst:
        #if (i%j == 0): c+=1
    #if c == 2: ans+=1

#print ans
def eval(x): return x*(x+1)/2;
x = 1
while (eval(x) < n):
    x+=1
if eval(x) == n: print "YES"
else: print "NO"
