import java.util.*; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long N = sc.nextLong(); long ans = binarysearch(N); if (ans!=-1) { System.out.println("YES"); System.out.println(ans); } else { System.out.println("NO"); } } static long binarysearch(long x) { long low=0L; long high=20_000_000_000L; while (low<=high) { long mid=(low+high)/2; long guess=f(mid); if (guess==x) { return mid; } else if (guess > x) { high = mid-1; } else { low = mid+1; } } return -1; } static long f(long x) { return x*(x+1)/2; } }