# frozen_string_literal: true def solve r = Math.sqrt(2 * N) (r.ceil - 1..r.floor).each do |i| return "YES\n#{i}" if i * (i + 1) == 2 * N return 'NO' end end N = gets.to_i puts solve