n=gets.to_i
d=1<<(n.bit_length-1)
if d==n
puts "No"
else
puts "Yes"
if d*2-1==n
(1...n*2).map{|i|puts "#{i} #{i+1}"}
else
d-=1
(1...d).map{|i|puts "#{i} #{i+1}"}
puts "#{d} #{n+1}"
(n+1...n+d).map{|i|puts "#{i} #{i+1}"}
d+=1

if n>d
puts "#{d} 1"
puts "#{d+1} 1"
puts "#{n+d} #{d+1}"
puts "#{n+d+1} #{d}"
(d+2..n).map{|i|
puts "#{i} #{i-d}"
puts "#{n+i} #{i-1}"
}
end
end
end