Problem:
Score : 700 points

Problem Statement

You are given an integer N. Determine if there exists a tree with 2N vertices numbered 1 to 2N satisfying the following condition, and show one such tree if the answer is yes.

Assume that, for each integer i between 1 and N (inclusive), Vertex i and N+i have the weight i. Then, for each integer i between 1 and N, the bitwise XOR of the weights of the vertices on the path between Vertex i and N+i (including themselves) is i.

Constraints

N is an integer.

1 \leq N \leq 10^{5}

Input

Input is given from Standard Input in the following format:

N

Output

If there exists a tree satisfying the condition in the statement, print Yes; otherwise, print No.
Then, if such a tree exists, print the 2N-1 edges of such a tree in the subsequent 2N-1 lines, in the following format:

a_{1} b_{1}
\vdots
a_{2N-1} b_{2N-1}

Here each pair (a_i, b_i) means that there is an edge connecting Vertex a_i and b_i. The edges may be printed in any order.

Sample Input 1

3

Sample Output 1

Yes
1 2
2 3
3 4
4 5
5 6

The sample output represents the following graph:

Sample Input 2

1

Sample Output 2

No

There is no tree satisfying the condition.

Solution in Rust (1.15.1) (judge verdict: Wrong Answer)

#[allow(unused_imports)]
use std::cmp::{max, min, Ordering};
#[allow(unused_imports)]
use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, VecDeque};
#[allow(unused_imports)]
use std::io::{stderr, stdin, stdout, BufWriter, StdoutLock, Write};
#[allow(unused_imports)]
use std::iter::FromIterator;
#[allow(unused_imports)]
use std::{i64, u64, usize};
#[allow(unused_macros)]
macro_rules ! input { ( source = $ s : expr , $ ( $ r : tt ) * ) => { let mut iter = $ s . split_whitespace ( ) ; let mut next = || { iter . next ( ) . unwrap ( ) } ; input_inner ! { next , $ ( $ r ) * } } ; ( $ ( $ r : tt ) * ) => { let stdin = std :: io :: stdin ( ) ; let mut bytes = std :: io :: Read :: bytes ( std :: io :: BufReader :: new ( stdin . lock ( ) ) ) ; let mut next = move || -> String { bytes . by_ref ( ) . map ( | r | r . unwrap ( ) as char ) . skip_while ( | c | c . is_whitespace ( ) ) . take_while ( | c |! c . is_whitespace ( ) ) . collect ( ) } ; input_inner ! { next , $ ( $ r ) * } } ; }
#[allow(unused_macros)]
macro_rules ! input_inner { ( $ next : expr ) => { } ; ( $ next : expr , ) => { } ; ( $ next : expr , $ var : ident : $ t : tt $ ( $ r : tt ) * ) => { let $ var = read_value ! ( $ next , $ t ) ; input_inner ! { $ next $ ( $ r ) * } } ; ( $ next : expr , mut $ var : ident : $ t : tt $ ( $ r : tt ) * ) => { let mut $ var = read_value ! ( $ next , $ t ) ; input_inner ! { $ next $ ( $ r ) * } } ; }
#[allow(unused_macros)]
macro_rules ! read_value { ( $ next : expr , ( $ ( $ t : tt ) ,* ) ) => { ( $ ( read_value ! ( $ next , $ t ) ) ,* ) } ; ( $ next : expr , [ $ t : tt ; $ len : expr ] ) => { ( 0 ..$ len ) . map ( | _ | read_value ! ( $ next , $ t ) ) . collect ::< Vec < _ >> ( ) } ; ( $ next : expr , [ $ t : tt ] ) => { { let len = read_value ! ( $ next , usize ) ; ( 0 .. len ) . map ( | _ | read_value ! ( $ next , $ t ) ) . collect ::< Vec < _ >> ( ) } } ; ( $ next : expr , chars ) => { read_value ! ( $ next , String ) . chars ( ) . collect ::< Vec < char >> ( ) } ; ( $ next : expr , bytes ) => { read_value ! ( $ next , String ) . into_bytes ( ) } ; ( $ next : expr , usize1 ) => { read_value ! ( $ next , usize ) - 1 } ; ( $ next : expr , $ t : ty ) => { $ next ( ) . parse ::<$ t > ( ) . expect ( "Parse error" ) } ; }
#[allow(dead_code)]
struct Writer {
    s: String,
}
#[allow(unused_imports)]
use std::fmt::Display;
#[allow(dead_code)]
#[doc = " let mut writer = Writer::new();"]
#[doc = " writer.writeln(hoge);"]
#[doc = " writer.flush()"]
impl Writer {
    #[allow(dead_code)]
    pub fn new() -> Writer {
        Writer { s: String::new() }
    }
    #[allow(dead_code)]
    pub fn flush(&mut self) {
        print!("{}", self.s);
        self.s.clear();
    }
    pub fn write<T: Display>(&mut self, x: T) {
        self.s.push_str(&format!("{}", x));
    }
    pub fn writeln<T: Display>(&mut self, x: T) {
        self.s.push_str(&format!("{}", x));
        self.s.push('\n');
    }
    #[allow(dead_code)]
    pub fn write_vec<T: Display>(&mut self, xs: &Vec<T>) {
        if xs.len() == 0 {
            self.writeln("");
            return;
        }
        self.write(&format!("{}", xs[0]));
        for i in 1..xs.len() {
            self.write(&format!(" {}", xs[i]));
        }
        self.writeln("");
    }
}
#[allow(unused_macros)]
macro_rules ! dbg { ( $ ( $ a : expr ) ,* ) => { writeln ! ( & mut stderr ( ) , concat ! ( $ ( stringify ! ( $ a ) , " = {:?}, " ) ,* ) , $ ( $ a ) ,* ) . unwrap ( ) ; } }
#[allow(dead_code)]
const INF_U: u64 = 1_000_000_000_000_000;
#[allow(dead_code)]
const INF_I: i64 = 1_000_000_000_000_000;
#[allow(non_snake_case)]
#[allow(dead_code)]
fn main() {
    input! {
        n: usize,
    }
    let mut tmp = n + 1;
    if n == 1 {
        println!("No");
        return;
    }
    while tmp > 1 {
        if tmp % 2 != 0 {
            println!("No");
            return;
        }
        tmp /= 2;
    }
    println!("Yes");
    for i in 1..2*n {
        println!("{} {}", i, i+1);
    }
}