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 long long UNDEF = -1;
const long long INF = 1e18;
template <typename T>
inline bool chkmax(T &aa, T bb) {
  return aa < bb ? aa = bb, true : false;
}
template <typename T>
inline bool chkmin(T &aa, T bb) {
  return aa > bb ? aa = bb, true : false;
}
vector<int> perm;
vector<pair<int, int> > solve(int n) {
  perm.resize(n);
  vector<pair<int, int> > v;
  for (int x = 0; x < n; x++)
    for (int y = x + 1; y < n; y++) {
      v.push_back(make_pair(x, y));
    }
  do {
    for (int k = 0; k < n; k++) perm[k] = k;
    for (auto &w : v) {
      swap(perm[w.first], perm[w.second]);
    }
    bool ok = 1;
    for (int k = 0; k < n; k++)
      if (perm[k] != k) {
        ok = 0;
        break;
      }
    if (ok) {
      return v;
    }
  } while (next_permutation(v.begin(), v.end()));
  return v;
}
bool check(int n, vector<pair<int, int> > v) {
  perm.resize(n);
  for (int k = 0; k < n; k++) perm[k] = k;
  for (auto &w : v) {
    swap(perm[w.first], perm[w.second]);
  }
  bool ok = 1;
  for (int k = 0; k < n; k++)
    if (perm[k] != k) {
      ok = 0;
      break;
    }
  return ok;
}
pair<int, int> head, tail;
map<pair<int, int>, pair<int, int> > fwd, bk;
pair<int, int> norm(pair<int, int> w) {
  if (w.first > w.second) swap(w.first, w.second);
  return w;
}
void loopcheck() {
  pair<int, int> now = head;
  while (now != tail) {
    now = fwd[now];
  }
}
void insBefore(pair<int, int> existing, pair<int, int> fresh) {
  existing = norm(existing);
  fresh = norm(fresh);
  if (existing == head) {
    head = fresh;
    fwd[fresh] = existing;
    bk[existing] = fresh;
  } else {
    pair<int, int> before = bk[existing];
    fwd[before] = fresh;
    bk[fresh] = before;
    fwd[fresh] = existing;
    bk[existing] = fresh;
  }
}
void insAfter(pair<int, int> existing, pair<int, int> fresh) {
  existing = norm(existing);
  fresh = norm(fresh);
  if (existing == tail) {
    tail = fresh;
    fwd[existing] = fresh;
    bk[fresh] = existing;
  } else {
    pair<int, int> after = fwd[existing];
    fwd[existing] = fresh;
    bk[fresh] = existing;
    fwd[fresh] = after;
    bk[after] = fresh;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n;
  scanf("%d", &n);
  if (n == 1) {
    printf("YES\n");
    return 0;
  }
  int rem = n % 4;
  if (n >= 4 && (rem == 0 || rem == 1)) {
    vector<pair<int, int> > p4 = solve(4);
    head = p4[0];
    tail = p4[p4.size() - 1];
    for (int i = 1; i < p4.size(); i++) {
      fwd[p4[i - 1]] = p4[i];
      bk[p4[i]] = p4[i - 1];
    }
    for (int b = 4; b + 4 <= n; b += 4) {
      for (int x = 0; x < b; x += 2) {
        int y = x + 1;
        for (int z = b; z < b + 4; z++) {
          insBefore(make_pair(x, y), make_pair(x, z));
          insAfter(make_pair(x, y), make_pair(y, z));
        }
      }
      for (auto &w : p4) {
        insAfter(tail, make_pair(w.first + b, w.second + b));
      }
    }
    if (rem == 1) {
      for (int x = 0; x < n - 1; x += 2) {
        int y = x + 1;
        int z = n - 1;
        {
          insBefore(make_pair(x, y), make_pair(x, z));
          insAfter(make_pair(x, y), make_pair(y, z));
        }
      }
    }
    printf("YES\n");
    pair<int, int> now = head;
    printf("%d %d\n", now.first + 1, now.second + 1);
    while (now != tail) {
      now = fwd[now];
      printf("%d %d\n", now.first + 1, now.second + 1);
    }
  } else {
    printf("NO\n");
  }
}