program skolem_xor_tree
  implicit none
  integer :: n, x, y, i
  read(*,*) n
  if (and(n,n-1) == 0) then
    write(*,'(a)') "No"
    stop
  end if
  write(*,'(a)') "Yes"
  write(*,'(i0,x,i0)') 1, 2
  write(*,'(i0,x,i0)') 2, 3
  write(*,'(i0,x,i0)') 3, n+1
  write(*,'(i0,x,i0)') n+1, n+2
  write(*,'(i0,x,i0)') n+2, n+3
  do i = 5, n, 2
    write(*,'(i0,x,i0)') 1, i-1
    write(*,'(i0,x,i0)') 1, i
    write(*,'(i0,x,i0)') i-1, n+i
    write(*,'(i0,x,i0)') i, n+i-1
  end do
  if (mod(n,2) == 0) then
    x = n/2
    y = xor(n+1,x)
    do while (x == y)
      x = x-1
      y = xor(n+1,x)
    end do
    write(*,'(i0,x,i0)') x, n
    write(*,'(i0,x,i0)') y, 2*n
  end if
  stop
end program skolem_xor_tree