let () =
    let log2 n =
        let rec loop i acc =
            if i = 0 then acc - 1 else loop (i lsr 1) (acc + 1)
        in
        loop n 0
    in
    let main () =
        let n = int_of_string (read_line ()) in
        if n land (n - 1) = 0 then print_endline "No" else (
            print_endline "Yes";
            for i = 1 to (n - 1) / 2 do
                Printf.printf "%d %d\n" 1 (2 * i);
                Printf.printf "%d %d\n" (2 * i) (2 * i + 1);
                Printf.printf "%d %d\n" 1 (2 * i + 1 + n);
                Printf.printf "%d %d\n" (2 * i + n) (2 * i + 1 + n);
            done;
            Printf.printf "%d %d\n" 3 (n + 1);
            if n mod 2 = 0 then (
                let k = 1 lsl (log2 n) in
                let a = k + 1 + n in
                let b = k lxor n in
                Printf.printf "%d %d\n" a (n + n);
                Printf.printf "%d %d\n" b n
            )
        )
    in
    main ()