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>
inline int pidorand() { return ((rand() & 32767) << 15) | (rand() & 32767); }
using namespace std;
inline int nxt() {
  int x;
  scanf("%d", &x);
  return x;
}
bool check(int n, const vector<pair<int, int>>& a) {
  vector<vector<char>> used(n, vector<char>(n, 0));
  if (a.size() != n * (n - 1) / 2) {
    return false;
  }
  vector<int> p(n);
  for (int i = 0; i < n; ++i) {
    p[i] = i;
  }
  auto lol = p;
  for (auto q : a) {
    swap(p[q.first], p[q.second]);
    if (q.first > q.second) {
      swap(q.first, q.second);
    } else if (q.first == q.second) {
      return false;
    }
    if (used[q.first][q.second]) {
      return false;
    }
    used[q.first][q.second] = 1;
  }
  return p == lol;
}
void add(vector<pair<int, int>>& ans, int s1, int s2) {
  s1 *= 4;
  s2 *= 4;
  for (int i = 0; i < 4; ++i) {
    ans.push_back({s1 + i, s2 + i});
  }
  for (int i = 0; i < 4; ++i) {
    ans.push_back({s1 + i, s2 + (i ^ 1)});
  }
  for (int i = 0; i < 4; ++i) {
    ans.push_back({s1 + i, s2 + (i ^ 2)});
  }
  for (int i = 0; i < 4; ++i) {
    ans.push_back({s1 + i, s2 + (i ^ 3)});
  }
}
void add4(vector<pair<int, int>>& ans, int s) {
  s *= 4;
  ans.push_back({s + 0, s + 1});
  ans.push_back({s + 0, s + 2});
  ans.push_back({s + 1, s + 3});
  ans.push_back({s + 0, s + 3});
  ans.push_back({s + 1, s + 2});
  ans.push_back({s + 2, s + 3});
}
vector<pair<int, int>> make4(int n) {
  vector<pair<int, int>> ans;
  for (int i = 0; i < n / 4; ++i) {
    add4(ans, i);
  }
  for (int i = 0; i < n / 4; ++i) {
    for (int j = 0; j < i; ++j) {
      add(ans, j, i);
    }
  }
  return ans;
}
int main() {
  int n = nxt();
  vector<pair<int, int>> ans;
  if (n % 4 == 0) {
    ans = make4(n);
  } else if (n % 4 == 1) {
    auto tmp = make4(n - 1);
    for (auto p : tmp) {
      int x = p.first, y = p.second;
      if (x > y) {
        swap(x, y);
      }
      if (y == x + 1 && x % 2 == 0) {
        ans.push_back({n - 1, x});
        ans.push_back({x, y});
        ans.push_back({n - 1, y});
      } else {
        ans.push_back(p);
      }
    }
  } else {
    printf("NO\n");
    return 0;
  }
  printf("YES\n");
  for (auto p : ans) {
    if (p.first > p.second) {
      swap(p.first, p.second);
    }
    printf("%d %d\n", p.first + 1, p.second + 1);
  }
  return 0;
}