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;
struct point {
  int a, b;
} a[100000], b[100000];
int tt, n, i, j, k, m, x, y, p, z, s[100000];
bool q;
int len(point x) { return x.a * x.a + x.b * x.b; }
bool cmp(point x, point y) { return len(x) < len(y); }
bool cmpt(point x, point y) { return atan2(x.a, x.b) > atan2(y.a, y.b); }
void add(int xx, int yy) {
  if (abs(xx) + abs(yy) < abs(p) + abs(z)) {
    p = xx;
    z = yy;
    b[k].a = p - x;
    b[k].b = z - y;
  }
}
int main() {
  for (i = 1; i <= 200; i++)
    for (j = 0; j <= i; j++) {
      a[m].a = i;
      a[m++].b = j;
    }
  sort(a, a + m, cmp);
  k = 0;
  for (i = 1; i < m; i++)
    if (cmp(a[k], a[i]))
      a[++k] = a[i];
    else if (len(a[k]) == len(a[i]) && a[k].a + a[k].b > a[i].a + a[i].b)
      a[k] = a[i];
  s[0] = len(a[0]) & 1;
  for (i = 1; i <= k; i++) s[i] = (s[i - 1] + len(a[i])) & 1;
  scanf("%d", &n);
  m = k + 1;
  if (s[n - 1]) {
    q = true;
    i = n;
    j = s[i];
  } else {
    q = false;
    i = n - 1;
  }
  puts("YES");
  for (x = y = k = 0; i >= 0; i--, k++) {
    if (q && ((len(a[i]) & 1) == j)) {
      k--;
      q = false;
      continue;
    }
    p = z = 1e7;
    add(x + a[i].a, y + a[i].b);
    add(x + a[i].a, y - a[i].b);
    add(x - a[i].a, y + a[i].b);
    add(x - a[i].a, y - a[i].b);
    add(x + a[i].b, y + a[i].a);
    add(x + a[i].b, y - a[i].a);
    add(x - a[i].b, y + a[i].a);
    add(x - a[i].b, y - a[i].a);
    x = p;
    y = z;
  }
  sort(b, b + k, cmpt);
  for (x = y = i = 0; i < k; i++) {
    printf("%d %d\n", x, y);
    x += b[i].a;
    y += b[i].b;
  }
  return 0;
}