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.util.*;


public class A
{
   public static void main(String[] args)
   {
      new A(new Scanner(System.in));
   }

   long p(int s, long n)
   {
      long tn = (n*(n-1))/2;
      long pn = (s-2)*tn+n;
      return pn;
   }

   double invp(int s, long x)
   {
      double sm4 = s-4.0;
      double sp = (8.0*s-16.0)*x+sm4*sm4;
      double srp = Math.sqrt(sp);
      double top = srp+s-4.0;
      double bot = 2.0*s-4.0;
      return top/bot;
   }

   boolean isngonal(int s, long x)
   {
      double nd = invp(s,x);
      long n = Math.round(nd);
      return p(s,n) == x;
   }

   public A(Scanner in)
   {
      boolean res = isngonal(3,in.nextInt());
      System.out.println(res?"YES":"NO");
   }
}
