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 mod = 1000000007;
long long powmod(long long a, long long b) {
  long long res = 1;
  a %= mod;
  assert(b >= 0);
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
  }
  return res;
}
int perm0[20][2] = {0, 8, 3, 5, 0, 6, 4, 8, 2, 8, 1, 6, 3, 6, 1, 5, 0, 7, 3, 8,
                    4, 5, 4, 7, 1, 7, 2, 6, 3, 7, 0, 5, 1, 8, 2, 5, 2, 7, 4, 6};
int perm1[16][2] = {0, 4, 0, 5, 0, 6, 1, 4, 1, 7, 0, 7, 1, 6, 2, 4,
                    3, 5, 2, 5, 1, 5, 2, 6, 3, 4, 3, 7, 2, 7, 3, 6};
int perm2[6][2] = {1, 3, 0, 3, 1, 2, 0, 1, 2, 3, 0, 2};
int perm3[10][2] = {2, 4, 0, 2, 3, 4, 1, 3, 1, 4, 0, 4, 0, 1, 2, 3, 1, 2, 0, 3};
int n, v[30];
int main() {
  scanf("%d", &n);
  if (n % 4 == 2 || n % 4 == 3) {
    puts("NO");
    return 0;
  }
  if (n == 1) {
    puts("YES");
    return 0;
  }
  puts("YES");
  for (int i = 0; i < n / 4; i++)
    for (int j = i + 1; j < n / 4; j++) {
      if (n % 4 == 0) {
        for (int k = 0; k < 4; k++) v[k] = i * 4 + 1 + k;
        for (int k = 0; k < 4; k++) v[k + 4] = j * 4 + 1 + k;
        for (int j = 0; j < 16; j++)
          printf("%d %d\n", v[perm1[j][0]], v[perm1[j][1]]);
      } else if (i == 0) {
        for (int k = 0; k < 5; k++) v[k] = i * 4 + 1 + k;
        for (int k = 0; k < 4; k++) v[k + 5] = j * 4 + 2 + k;
        for (int j = 0; j < 20; j++)
          printf("%d %d\n", v[perm0[j][0]], v[perm0[j][1]]);
      } else {
        for (int k = 0; k < 4; k++) v[k] = i * 4 + 2 + k;
        for (int k = 0; k < 4; k++) v[k + 4] = j * 4 + 2 + k;
        for (int j = 0; j < 16; j++)
          printf("%d %d\n", v[perm1[j][0]], v[perm1[j][1]]);
      }
    }
  for (int i = 0; i < n / 4; i++) {
    if (n % 4 == 0) {
      for (int k = 0; k < 4; k++) v[k] = i * 4 + 1 + k;
      for (int j = 0; j < 6; j++)
        printf("%d %d\n", v[perm2[j][0]], v[perm2[j][1]]);
    } else if (i == 0) {
      for (int k = 0; k < 5; k++) v[k] = i * 4 + 1 + k;
      for (int j = 0; j < 10; j++)
        printf("%d %d\n", v[perm3[j][0]], v[perm3[j][1]]);
    } else {
      for (int k = 0; k < 4; k++) v[k] = i * 4 + 2 + k;
      for (int j = 0; j < 6; j++)
        printf("%d %d\n", v[perm2[j][0]], v[perm2[j][1]]);
    }
  }
}