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>
#pragma GCC optimize("O3")
using namespace std;
int in() {
  int x;
  cin >> x;
  return x;
}
long long lin() {
  long long x;
  cin >> x;
  return x;
}
string stin() {
  string s;
  cin >> s;
  return s;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline void print(pair<T, T> p) {
  cout << "(" << p.first << "," << p.second << ") ";
}
template <class T>
inline void print(vector<pair<T, T>> v) {
  for (auto e : v) print(e);
  cout << "\n";
}
template <class T>
inline void print(T v) {
  for (auto e : v) cout << e << " ";
  cout << "\n";
}
vector<int> a;
void sw(int x, int y) {
  swap(a[x], a[y]);
  cout << x + 1 << " " << y + 1 << "\n";
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cout << fixed << setprecision(15);
  int n = in();
  if ((n % 4) > 1)
    cout << "NO\n";
  else {
    cout << "YES\n";
    if (n == 1) return 0;
    for (long long i = 0; i < n; i++) a.push_back(i);
    int pre = -1;
    for (long long i = 0; i < n - 4; i++) {
      if (pre == -1) {
        if (a[i] == i) {
          sw(i, n - 1);
          for (long long j = n - 2; j >= i + 2; j--) sw(i, j);
          sw(i + 1, n - 1);
          sw(i, i + 1);
          pre = n - 1;
        } else {
          for (long long j = n - 1; j >= i + 1; j--)
            if (a[j] != i) sw(i, j);
          for (long long j = i + 1; j <= n - 1; ++j)
            if (a[j] == i) sw(i, j);
        }
      } else {
        if (a[pre] == i) {
          if (i + 1 != pre)
            sw(i + 1, pre);
          else
            pre = -1;
          for (long long j = n - 1; j >= i + 1; j--)
            if (j != pre) sw(i, j);
        } else if (a[i] == i) {
          for (long long j = n - 1; j >= i + 2; j--)
            if (j != pre) sw(i, j);
          sw(i + 1, (pre == n - 1 ? n - 2 : n - 1));
          sw(i, i + 1);
          pre = (pre == n - 1 ? n - 2 : n - 1);
        } else {
          for (long long j = n - 1; j >= i + 1; j--)
            if (a[j] != i and j != pre) sw(i, j);
          for (long long j = i + 1; j <= n - 1; ++j)
            if (a[j] == i) sw(i, j);
          pre = -1;
        }
      }
    }
    vector<pair<int, int>> v;
    for (long long i = n - 4; i <= n - 2; ++i) {
      for (long long j = i + 1; j <= n - 1; ++j) {
        if (i == n - 4 and j == pre) continue;
        v.emplace_back(i, j);
      }
    }
    sort(begin(v), end(v));
    vector<int> ans;
    for (long long i = 0; i < n; i++) ans.push_back(i);
    do {
      auto b = a;
      for (auto e : v) {
        swap(b[e.first], b[e.second]);
      }
      if (ans == b) {
        for (auto e : v) sw(e.first, e.second);
        break;
      }
    } while (next_permutation(begin(v), end(v)));
  }
}