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 static java.util.Arrays.deepToString;

import java.io.*;
import java.math.BigInteger;
import java.util.*;


public class A {

    static void show(long[][] c){
        for(int i = 0; i < c.length; i++){                      
            for(int j = 0; j < c[i].length; j++){
                System.out.print(c[i][j]);
            }
            System.out.println();
        }
    }
    static void solve() throws Exception {
        int n = nextInt();
        int[] a = new int[51];
        
        a[0] = 1;
        for(int i = 1; i <= 50; i++){
            a[i] = a[i - 1] + (i + 1);
        }
        boolean b = false;
        for(int i = 0; i <= 50; i++){
            if(a[i] == n){
                b = true;
                break;
            }
        }
        if(b){
            System.out.print("YES");
        }else{
            System.out.print("NO");
        }   
    }

    static BufferedReader br;
    static StringTokenizer st;
    static PrintWriter out;

    static void debug(Object... a) {
        System.err.println(deepToString(a));
    }

    static int nextInt() throws IOException {
        return Integer.parseInt(next());
    }

    static String next() throws IOException {
        while (st == null || !st.hasMoreTokens()) {
            String line = br.readLine();
            if (line == null) {
                return null;
            }
            st = new StringTokenizer(line);
        }
        return st.nextToken();
    }

    static long nextLong() throws IOException {
        return Long.parseLong(next());
    }

    static double nextDouble() throws IOException {
        return Double.parseDouble(next());
    }

    public static void main(String[] args) {
        try {           
            br = new BufferedReader(new InputStreamReader(System.in));
            solve();            
            br.close();
        } catch (Throwable e) {
            e.printStackTrace();
            System.exit(1);
        }
    }
}