use std::collections::BTreeSet;

fn main() {
    let (r, w) = (std::io::stdin(), std::io::stdout());
    let mut sc = IO::new(r.lock(), w.lock());
    let n: usize = sc.read();
    let mut xor = 0;
    for i in 1..(n + 1) {
        xor ^= i;
    }

    if xor == 0 {
        println!("Yes");
        for i in 0..(2 * n - 1) {
            println!("{} {}", i + 1, i + 2);
        }
    } else if xor == 1 {
        if n == 1 {
            println!("No");
            return;
        }
        println!("Yes");
        for i in 0..(n - 2) {
            println!("{} {}", i + 2, i + 3);
        }
        for i in 0..(n - 2) {
            println!("{} {}", i + 2 + n, i + 3 + n);
        }
        println!("{} {}", n, n + 2);
        println!("1 2");
        println!("3 {}", n + 1);
    } else if xor == n {
        if n.count_ones() == 1 {
            println!("No");
            return;
        }
        let mut set = BTreeSet::new();
        for i in 0..30 {
            let x = 1 << i;
            if x & n != 0 {
                set.insert(x);
            }
        }

        let mut other = vec![];
        for i in 1..n {
            if set.contains(&i) {
                continue;
            }
            other.push(i);
        }
        let set = set.into_iter().collect::<Vec<_>>();

        println!("Yes");
        for i in 1..set.len() {
            println!("{} {}", set[i - 1], set[i]);
            println!("{} {}", set[i - 1] + n, set[i] + n);
        }
        for i in 1..other.len() {
            println!("{} {}", other[i - 1], other[i]);
            println!("{} {}", other[i - 1] + n, other[i] + n);
        }
        println!("{} {}", set[set.len() - 1], other[0]);
        println!("{} {}", set[0] + n, other[other.len() - 1]);
        println!("{} {}", set[set.len() - 1] + n, other[0] + n);
        println!("{} {}", n, set[0]);
        println!("{} {}", 2 * n, set[set.len() - 1]);
    } else if xor == n + 1 {
        if n == 2 {
            println!("No");
            return;
        }
        let mut set = BTreeSet::new();
        for i in 1..30 {
            let x = 1 << i;
            if x & n != 0 {
                set.insert(x);
            }
        }

        let mut other = vec![];
        for i in 2..n {
            if set.contains(&i) {
                continue;
            }
            other.push(i);
        }
        let mut set = set.into_iter().collect::<Vec<_>>();
        set.sort();
        set.reverse();
        other.sort();

        println!("Yes");
        for i in 1..set.len() {
            println!("{} {}", set[i - 1], set[i]);
            println!("{} {}", set[i - 1] + n, set[i] + n);
        }
        for i in 1..other.len() {
            println!("{} {}", other[i - 1], other[i]);
            println!("{} {}", other[i - 1] + n, other[i] + n);
        }

        println!("{} {}", set[set.len() - 1], other[0]);
        println!("{} {}", set[0] + n, other[other.len() - 1]);
        println!("{} {}", set[set.len() - 1] + n, other[0] + n);
        println!("{} {}", n, set[0]);
        println!("{} {}", 2 * n, set[set.len() - 1]);
        println!("1 2");
        println!("3 {}", n + 1);
    } else {
        unreachable!()
    }
}

pub struct IO<R, W: std::io::Write>(R, std::io::BufWriter<W>);

impl<R: std::io::Read, W: std::io::Write> IO<R, W> {
    pub fn new(r: R, w: W) -> Self {
        IO(r, std::io::BufWriter::new(w))
    }
    pub fn write<S: ToString>(&mut self, s: S) {
        use std::io::Write;
        self.1.write(s.to_string().as_bytes()).unwrap();
    }
    pub fn read<T: std::str::FromStr>(&mut self) -> T {
        use std::io::Read;
        let buf = self
            .0
            .by_ref()
            .bytes()
            .map(|b| b.unwrap())
            .skip_while(|&b| b == b' ' || b == b'\n' || b == b'\r' || b == b'\t')
            .take_while(|&b| b != b' ' && b != b'\n' && b != b'\r' && b != b'\t')
            .collect::<Vec<_>>();
        unsafe { std::str::from_utf8_unchecked(&buf) }
            .parse()
            .ok()
            .expect("Parse error.")
    }
    pub fn vec<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read()).collect()
    }
    pub fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
}


Measured memory_bytes: 6780