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
//package com.company;
import com.sun.nio.sctp.SctpStandardSocketOptions;
import javax.swing.*;
import javax.swing.plaf.synth.SynthLookAndFeel;
import java.math.BigInteger;
import java.util.Calendar;
import java.net.StandardSocketOptions;
import java.util.*;
import java.util.Calendar;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Random;
import java.util.StringTokenizer;
import java.io.*;
import java.util.ArrayList;
import java.math.BigInteger;
    /*
                                                DOMINGO_GIRL :)
                                                ─────────▄──────────────▄
                                                ────────▌▒█───────────▄▀▒▌
                                                ────────▌▒▒▀▄───────▄▀▒▒▒▐
                                                ───────▐▄▀▒▒▀▀▀▀▄▄▄▀▒▒▒▒▒▐
                                                ─────▄▄▀▒▒▒▒▒▒▒▒▒▒▒█▒▒▄█▒▐
                                                ───▄▀▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▀██▀▒▌
                                                ──▐▒▒▒▄▄▄▒▒▒▒▒▒▒▒▒▒▒▒▒▀▄▒▒▌
                                                ──▌▒▒▐▄█▀▒▒▒▒▄▀█▄▒▒▒▒▒▒▒█▒▐
                                                ─▐▒▒▒▒▒▒▒▒▒▒▒▌██▀▒▒▒▒▒▒▒▒▀▄▌
                                                ─▌▒▀▄██▄▒▒▒▒▒▒▒▒▒▒▒░░░░▒▒▒▒▌
                                                ─▌▀▐▄█▄█▌▄▒▀▒▒▒▒▒▒░░░░░░▒▒▒▐ Wow
                                                ▐▒▀▐▀▐▀▒▒▄▄▒▄▒▒▒▒▒░░░░░░▒▒▒▒▌
                                                ▐▒▒▒▀▀▄▄▒▒▒▄▒▒▒▒▒▒░░░░░░▒▒▒▐
                                                ─▌▒▒▒▒▒▒▀▀▀▒▒▒▒▒▒▒▒░░░░▒▒▒▒▌
                                                ─▐▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▐
                                                ──▀▄▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▄▒▒▒▒▌
                                                ────▀▄▒▒▒▒▒▒▒▒▒▒▄▄▄▀▒▒▒▒▄▀
                                                ───▐▀▒▀▄▄▄▄▄▄▀▀▀▒▒▒▒▒▄▄▀
                                                ──▐▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▀▀
                                            */

    public class Main {
        //static final int mod = (int)1e9+7;
        public static void main(String[] arg) {
            Scanner sc = new Scanner(System.in);
            int n=sc.nextInt();
            int Tn=2*n;boolean f=false;
            ArrayList<Integer>ar=divs(Tn);
            for(int i=0;i<ar.size()-1;i++){
                if(ar.get(i+1)-ar.get(i)==1&&ar.get(i+1)*ar.get(i)==Tn)f=true;
            }

            if(f||n==1)System.out.println("YES");
            else System.out.println("NO");

        }

        static ArrayList<Integer> divs(int l) {
            ArrayList<Integer> ret = new ArrayList();
            ret.add(1);
            for(int i = 2; i*i <= l; i++) {
                if(l%i==0) {
                    ret.add(i);
                    if(l/i!=i) ret.add(l/i);
                }
            }
            return ret;
        }

        static long firstDivisor(long n){
            long k=2;
            for(long i=2;i<=Math.sqrt(n);i++){
                if(n%i==0){
                    k=i;break;
                }
            }
            return k;
        }

        static boolean isPerfectSquare(double x)
        {

            // Find floating point value of
            // square root of x.
            double sr = Math.sqrt(x);

            // If square root is an integer
            return ((sr - Math.floor(sr)) == 0);
        }

        static boolean isPrime(long n) {
            // Corner cases
            if (n <= 1) return false;
            if (n <= 3) return true;

            // This is checked so that we can skip
            // middle five numbers in below loop
            if (n % 2 == 0 || n % 3 == 0) return false;

            for (long i = 5; i * i <= n; i = i + 6)
                if (n % i == 0 || n % (i + 2) == 0)
                    return false;

            return true;
        }

    }