N = gets.to_i n = ((N*2)**0.5).floor if N * 2 == n * (n + 1) puts :YES, n else puts :NO end