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();

    match solve(n) {
        Some(edges) => {
            sc.write("Yes\n");
            for (a, b) in edges.into_iter() {
                sc.write(format!("{} {}\n", a, b));
            }
        }
        None => println!("No"),
    }
}

fn solve(n: usize) -> Option<Vec<(usize, usize)>> {
    let mut total_xor = 0;
    for i in 1..=n {
        total_xor ^= i;
    }

    if total_xor == 0 {
        let mut edges = vec![];
        for i in 2..=n {
            edges.push((i - 1, i));
            edges.push((i - 1 + n, i + n));
        }
        edges.push((n, n + 1));
        return Some(edges);
    }

    let mut pairs = BTreeSet::new();
    for i in 1..=n {
        let j = total_xor ^ i;
        let (i, j) = if i < j { (i, j) } else { (j, i) };
        if j <= n && i <= n {
            pairs.insert((i, j));
        }
    }

    if pairs.len() <= 1 {
        return None;
    }

    let mut iter = pairs.into_iter();
    let (a1, b1) = iter.next().unwrap();
    let (a2, b2) = iter.next().unwrap();

    let mut x1 = vec![];
    if a1 != 0 {
        x1.push(a1);
    }
    x1.push(b1);

    let mut x2 = vec![];
    if a2 != 0 {
        x2.push(a2);
    }
    x2.push(b2);

    let mut x3 = vec![];
    for i in 1..=n {
        if !x1.contains(&i) && !x2.contains(&i) {
            x3.push(i);
        }
    }

    let mut edges = vec![];
    for i in 1..x1.len() {
        edges.push((x1[i - 1], x1[i]));
        edges.push((x1[i - 1] + n, x1[i] + n));
    }
    for i in 1..x2.len() {
        edges.push((x2[i - 1], x2[i]));
        edges.push((x2[i - 1] + n, x2[i] + n));
    }
    for i in 1..x3.len() {
        edges.push((x3[i - 1], x3[i]));
        edges.push((x3[i - 1] + n, x3[i] + n));
    }
    edges.push((x1[x1.len() - 1], x2[0]));
    edges.push((x2[x2.len() - 1], x3[0]));
    edges.push((x3[x3.len() - 1], x2[0] + n));
    edges.push((x2[x2.len() - 1] + n, x3[0] + n));
    edges.push((x2[x2.len() - 1], x1[0] + n));
    Some(edges)
}

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 {
        Self(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: 8024