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;
void model(vector<int>& a, const vector<pair<int, int> >& v) {
  for (pair<int, int> p : v) swap(a[p.first], a[p.second]);
}
bool check(int n, const vector<pair<int, int> >& v) {
  vector<int> a(n);
  for (int i = 0; i < n; ++i) a[i] = i;
  model(a, v);
  for (int i = 0; i < n; ++i)
    if (a[i] != i) return false;
  return true;
}
vector<pair<int, int> > sol0, sol1, sol5;
void solve(int n, vector<pair<int, int> >& res) {
  if (n < 4) return;
  solve(n - 4, res);
  for (int i = 0; i + 1 < n - 4; i += 2) {
    res.push_back(pair<int, int>(i, n - 4));
    res.push_back(pair<int, int>(i + 1, n - 3));
    res.push_back(pair<int, int>(i + 1, n - 4));
    res.push_back(pair<int, int>(i, n - 3));
    res.push_back(pair<int, int>(i, n - 2));
    res.push_back(pair<int, int>(i + 1, n - 1));
    res.push_back(pair<int, int>(i + 1, n - 2));
    res.push_back(pair<int, int>(i, n - 1));
  }
  if (n % 2) {
    res.push_back(pair<int, int>(n - 5, n - 4));
    res.push_back(pair<int, int>(n - 5, n - 3));
    res.push_back(pair<int, int>(n - 5, n - 2));
    res.push_back(pair<int, int>(n - 4, n - 1));
    res.push_back(pair<int, int>(n - 5, n - 1));
    for (pair<int, int> p : sol1) {
      res.push_back(pair<int, int>(p.first + n - 4, p.second + n - 4));
    }
  } else {
    for (pair<int, int> p : sol0) {
      res.push_back(pair<int, int>(p.first + n - 4, p.second + n - 4));
    }
  }
  assert(res.size() == n * (n - 1) / 2);
}
void solve0() {
  vector<pair<int, int> > v;
  for (int i = 0; i < 4; ++i)
    for (int j = i + 1; j < 4; ++j) v.push_back(pair<int, int>(i, j));
  do {
    if (check(4, v)) {
      sol0 = v;
      break;
    }
  } while (next_permutation(v.begin(), v.end()));
  assert(!sol0.empty());
}
void solve1() {
  vector<pair<int, int> > v;
  for (int i = 0; i < 4; ++i)
    for (int j = i + 1; j < 4; ++j)
      if (pair<int, int>(i, j) != pair<int, int>(0, 3))
        v.push_back(pair<int, int>(i, j));
  do {
    vector<int> st = {3, 0, 1, 2};
    vector<int> en = {0, 1, 2, 3};
    model(st, v);
    if (st == en) {
      sol1 = v;
      break;
    }
  } while (next_permutation(v.begin(), v.end()));
  assert(!sol1.empty());
}
void solve5() {
  vector<pair<int, int> > v;
  for (int i = 0; i < 5; ++i)
    for (int j = i + 1; j < 5; ++j) v.push_back(pair<int, int>(i, j));
  do {
    if (check(5, v)) {
      sol5 = v;
      break;
    }
  } while (next_permutation(v.begin(), v.end()));
  assert(!sol5.empty());
}
int main() {
  std::ios::sync_with_stdio(false);
  solve0();
  solve1();
  int n;
  cin >> n;
  if (n * (n - 1) / 2 % 2) {
    cout << "NO\n";
    return 0;
  }
  cout << "YES\n";
  vector<pair<int, int> > res;
  solve(n, res);
  for (int i = 0; i < res.size(); ++i) {
    cout << min(res[i].first, res[i].second) + 1 << " "
         << max(res[i].first, res[i].second) + 1 << endl;
  }
  return 0;
}