import java.util.*; import java.io.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); PrintWriter ou = new PrintWriter(System.out); int a = Integer.parseInt(sc.next()) - 3; boolean s = true; for(int i = 3 ; s && a >= 0 ; i++){ a -= i; if(a % i == 0){ ou.println("YES"); s = false; } } if(s) ou.println("NO"); ou.flush(); sc.close(); } }