Problem: It happened at the times of the Great Berland Empire. Once the Emperor dreamt that the Messenger from the gods ordered to build a temple whose base would be a convex polygon with n angles. Next morning the Emperor gave the command to build a temple whose base was a regular polygon with n angles. The temple was built but soon the Empire was shaken with disasters and crop failures. After an earthquake destroyed the temple, the Emperor understood that he somehow caused the wrath of gods to fall on his people. He ordered to bring the wise man. When the wise man appeared, the Emperor retold the dream to him and asked "Oh the wisest among the wisest, tell me how could I have infuriated the Gods?". "My Lord," the wise man answered. "As far as I can judge, the gods are angry because you were too haste to fulfill their order and didn't listen to the end of the message".

Indeed, on the following night the Messenger appeared again. He reproached the Emperor for having chosen an imperfect shape for the temple. "But what shape can be more perfect than a regular polygon!?" cried the Emperor in his dream. To that the Messenger gave a complete and thorough reply. 

  * All the vertices of the polygon should be positioned in the lattice points. 
  * All the lengths of its sides should be different. 
  * From the possible range of such polygons a polygon which maximum side is minimal possible must be chosen. 



You are an obedient architect who is going to make the temple's plan. Note that the polygon should be simple (having a border without self-intersections and overlapping) and convex, however, it is acceptable for three consecutive vertices to lie on the same line.

Input

The first line contains the single number n (3 ≤ n ≤ 10000).

Output

Print "YES" (without quotes) in the first line if it is possible to build a polygon possessing the needed qualities. In the next n lines print integer coordinates of the polygon vertices in the order in which they would be passed counter clockwise. The absolute value of the coordinates shouldn't exceed 109. No two vertices can coincide. It is permitted to print any of the possible solutions. Print "NO" if to build the polygon is impossible.

Examples

Input

3


Output

YES
0 0
1 0
0 2


Input

3


Output

YES
0 1
-1 0
-1 -1

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
bool check(int x) {
  vector<int> vec, pw;
  for (int i = 2; i <= x; i++) {
    int p = 0;
    while (x % i == 0) {
      ++p;
      x /= i;
    }
    if (p) vec.push_back(i), pw.push_back(p);
  }
  for (int i = 0; i < pw.size(); i++) {
    if (pw[i] % 2) {
      if (vec[i] % 4 == 3) return 0;
    }
  }
  return 1;
}
vector<int> vec, vec1;
vector<double> angle;
vector<pair<int, int> > XY;
const int N = 11000;
int id[N];
int main() {
  int n;
  scanf("%d", &n);
  int now = 1;
  while (vec.size() < n + 10) {
    if (check(now)) vec.push_back(now);
    ++now;
  }
  int sum = 0;
  for (int i = 0; i < n; i++) sum += vec[i];
  if (sum % 2) {
    for (int j = n - 1; j >= 0; j--) {
      if ((vec[j] - vec[n]) % 2) {
        swap(vec[j], vec[n]);
        vec1 = vec;
        vec1.resize(n);
        sort(vec1.begin(), vec1.end());
        break;
      }
    }
  } else {
    vec1 = vec;
    vec1.resize(n);
  }
  for (int i : vec1) {
    for (int j = 1; j * j <= i; j++) {
      int k = i - j * j;
      int t = round(sqrt(k));
      if (k == t * t) {
        XY.push_back(pair<int, int>(j, t));
        break;
      }
    }
  }
  int nx = 0, ny = 0;
  for (int i = n - 1; i >= 0; i--) {
    int x = XY[i].first, y = XY[i].second;
    int delta = 1e9;
    for (int times = 0; times < 2; times++) {
      swap(x, y);
      for (int fx = -1; fx <= 1; fx += 2) {
        for (int fy = -1; fy <= 1; fy += 2) {
          if (delta > abs(nx + fx * x) + abs(ny + fy * y)) {
            delta = abs(nx + fx * x) + abs(ny + fy * y);
            XY[i] = pair<int, int>(fx * x, fy * y);
          }
        }
      }
    }
    nx += XY[i].first, ny += XY[i].second;
  }
  assert(!nx && !ny);
  for (auto it : XY) {
    double ang = atan2(it.second, it.first);
    angle.push_back(ang);
  }
  for (int i = 0; i < n; i++) id[i] = i;
  sort(id, id + n, [](int a, int b) { return angle[a] < angle[b]; });
  puts("YES");
  for (int i = 0; i < n; i++) {
    printf("%d %d\n", nx, ny);
    nx += XY[id[i]].first, ny += XY[id[i]].second;
  }
  return 0;
}