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;
const int MAXL = 40000;
pair<int, int> p[MAXL];
int Init() {
  for (int i = 0; i * i < MAXL; i++) {
    for (int j = i; j * j + i * i < MAXL; j++) {
      int now = i * i + j * j;
      p[now].first = i;
      p[now].second = j;
    }
  }
  return 0;
}
inline bool cmp(pair<int, int> a, pair<int, int> b) {
  return atan2(a.second, a.first) < atan2(b.second, b.first) - (1e-8);
}
int L(int a, int b) { return a * a + b * b; }
int n;
int Solve() {
  vector<pair<int, int> > e;
  int sum = 0;
  scanf("%d", &n);
  for (int i = 0; i < MAXL && e.size() <= n; i++) {
    if (p[i].first == 0 && p[i].second == 0) continue;
    sum ^= p[i].first ^ p[i].second;
    e.push_back(p[i]);
  }
  reverse(e.begin(), e.end());
  for (vector<pair<int, int> >::iterator it = e.begin(); it != e.end(); it++) {
    if (((sum ^ it->first ^ it->second) & 1) == 0) {
      e.erase(it);
      break;
    }
  }
  int ix = 0, iy = 0;
  for (vector<pair<int, int> >::iterator it = e.begin(); it != e.end(); it++) {
    int fx = 1, fy = 1;
    int xx = it->first, yy = it->second;
    if (ix > 0) fx = -1;
    if (iy > 0) fy = -1;
    if (L(fx * xx + ix, fy * yy + iy) < L(fx * yy + ix, fy * xx + iy))
      *it = make_pair(fx * xx, fy * yy);
    else
      *it = make_pair(fx * yy, fy * xx);
    ix = it->first + ix;
    iy = it->second + iy;
  }
  sort(e.begin(), e.end(), cmp);
  puts("YES");
  for (vector<pair<int, int> >::iterator it = e.begin(); it != e.end(); it++) {
    printf("%d %d\n", ix, iy);
    ix += it->first;
    iy += it->second;
  }
  return 0;
}
int main() {
  Init();
  Solve();
  return 0;
}