Problem: Seyyed and MoJaK are friends of Sajjad. Sajjad likes a permutation. Seyyed wants to change the permutation in a way that Sajjad won't like it. Seyyed thinks more swaps yield more probability to do that, so he makes MoJaK to perform a swap between every pair of positions (i, j), where i < j, exactly once. MoJaK doesn't like to upset Sajjad.

Given the permutation, determine whether it is possible to swap all pairs of positions so that the permutation stays the same. If it is possible find how to do that. 

Input

The first line contains single integer n (1 ≤ n ≤ 1000) — the size of the permutation.

As the permutation is not important, you can consider ai = i, where the permutation is a1, a2, ..., an.

Output

If it is not possible to swap all pairs of positions so that the permutation stays the same, print "NO",

Otherwise print "YES", then print <image> lines: the i-th of these lines should contain two integers a and b (a < b) — the positions where the i-th swap is performed.

Examples

Input

3


Output

NO


Input

1


Output

YES

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const int oo = 0x3f3f3f3f;
const double eps = 1e-9;
vector<int> p, vg;
set<pair<int, int> > done;
bool cando(int i, int j) {
  return done.find(make_pair(min(i, j), max(i, j))) == done.end();
}
int moves = 0;
void doswap(int i, int j) {
  ++moves;
  assert(i != j);
  assert(min(i, j) >= 0 && max(i, j) < int((vg).size()));
  assert(cando(i, j));
  printf("%d %d\n", min(i, j) + 1, max(i, j) + 1);
  swap(p[i], p[j]);
  swap(vg[i], vg[j]);
  done.insert(make_pair(min(i, j), max(i, j)));
}
void brute_force(vector<int> pp) {
  int N = int((pp).size());
  vector<pair<int, int> > op;
  vector<int> aim = pp;
  sort((aim).begin(), (aim).end());
  for (int i = (0); i < (N); i++)
    for (int j = (0); j < (i); j++)
      if (cando(i, j)) op.push_back(make_pair(i, j));
  sort((op).begin(), (op).end());
  do {
    vector<int> tmp = pp;
    for (auto it : op) {
      swap(tmp[it.first], tmp[it.second]);
    }
    if (tmp == aim) {
      for (auto it : op) doswap(it.first, it.second);
      return;
    }
  } while (next_permutation((op).begin(), (op).end()));
  cerr << "EPIC FAIL\n";
}
int main() {
  ios::sync_with_stdio(false);
  int N;
  cin >> N;
  if (N == 1) {
    cout << "YES\n";
    return 0;
  }
  if ((N * (N - 1)) % 4 != 0) {
    cout << "NO\n";
    return 0;
  }
  printf("YES\n");
  p = vector<int>(N);
  for (int i = (0); i < (N); i++) p[i] = i;
  vg = p;
  while (true) {
    vector<int> ids;
    for (int i = (0); i < (N); i++)
      if (p[i] != -1) ids.push_back(i);
    int S = int((ids).size());
    if (S <= 1) break;
    assert(ids[S - 1] == S - 1);
    if (S <= 5) {
      vector<int> tmp(S);
      for (int i = (0); i < (S); i++) tmp[i] = p[i];
      brute_force(tmp);
      break;
    }
    vector<int> x(S - 1);
    for (int i = (0); i < (S - 1); i++) x[i] = i;
    random_shuffle((x).begin(), (x).end());
    if (p[S - 1] == S - 1) {
      bool ok = false;
      while (!ok) {
        int z1 = max((rand() % (S - 1)), rand() % (S - 1));
        int z2 = max((rand() % (S - 1)), rand() % (S - 1));
        if (z1 == z2) continue;
        if (!cando(z1, S - 1) || !cando(z2, S - 1)) continue;
        if (!cando(z1, z2)) continue;
        ok = true;
        doswap(z2, S - 1);
        doswap(z2, z1);
        for (auto i : x) {
          if (i != z1 && i != z2 && cando(i, S - 1)) {
            doswap(i, S - 1);
          }
        }
        doswap(z1, S - 1);
      }
    } else {
      int id_largest = -1;
      for (int i = (0); i < (S); i++)
        if (p[i] == S - 1) id_largest = i;
      assert(id_largest != -1);
      if (cando(id_largest, S - 1)) {
        for (auto i : x) {
          if (i != id_largest && cando(i, S - 1)) {
            doswap(i, S - 1);
          }
        }
        doswap(id_largest, S - 1);
      } else {
        int z = S - 2;
        while (!cando(z, S - 1) || !cando(id_largest, z)) --z;
        assert(z >= 0);
        assert(z != id_largest);
        doswap(id_largest, z);
        for (auto i : x) {
          if (i != z && cando(i, S - 1)) {
            doswap(i, S - 1);
          }
        }
        doswap(z, S - 1);
      }
    }
    assert(p[S - 1] == S - 1);
    p[S - 1] = -1;
  }
  assert(moves == (N * (N - 1)) / 2);
  for (int i = (0); i < (N); i++) assert(vg[i] == i);
  return 0;
}