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 P = 1e9 + 7;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long qpow(long long a, long long n) {
  long long r = 1 % P;
  for (a %= P; n; a = a * a % P, n >>= 1)
    if (n & 1) r = r * a % P;
  return r;
}
void exgcd(long long a, long long b, long long &d, long long &first,
           long long &second) {
  b                          ? exgcd(b, a % b, d, second, first),
      second -= a / b *first : first = 1, second = 0, d = a;
}
long long inv(long long first) {
  return first <= 1 ? 1 : inv(P % first) * (P - P / first) % P;
}
const int N = 4e5 + 10, INF = 0x3f3f3f3f;
int a[N], n, m, k, t;
vector<int> g[N];
const int x4[] = {1, 1, 2, 1, 2, 3};
const int y4[] = {2, 3, 4, 4, 3, 4};
const int x5[] = {1, 1, 1, 2, 2, 3, 1, 3, 2, 4};
const int y5[] = {2, 3, 4, 3, 5, 5, 5, 4, 4, 5};
const int xx[] = {1, 1, 1, 2, 2, 1, 2, 3, 4, 3, 2, 3, 4, 4, 3, 4};
const int yy[] = {1, 2, 3, 1, 4, 4, 3, 1, 2, 2, 2, 3, 1, 4, 4, 3};
int main() {
  scanf("%d", &n);
  if (n * (n - 1) / 2 % 2) return puts("NO"), 0;
  puts("YES");
  m = n / 4;
  for (int i = 0; i <= m - 1; ++i)
    for (int j = i + 1; j <= m - 1; ++j) {
      for (int k = 0; k <= 15; ++k) {
        int first = i * 4 + xx[k], second = j * 4 + yy[k];
        printf("%d %d\n", first, second);
      }
    }
  if (m * 4 == n) {
    for (int i = 0; i <= m - 1; ++i)
      for (int k = 0; k <= 5; ++k) {
        int first = i * 4 + x4[k], second = i * 4 + y4[k];
        printf("%d %d\n", first, second);
      }
  } else {
    for (int i = 0; i <= m - 1; ++i)
      for (int k = 0; k <= 9; ++k) {
        int first = i * 4 + x5[k], second = i * 4 + y5[k];
        if (y5[k] == 5) second = n;
        printf("%d %d\n", first, second);
      }
  }
}