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
#include <bits/stdc++.h>
using namespace std;
struct ver {
  int x, y;
  ver operator+(ver p) { return (ver){x + p.x, y + p.y}; }
} v[160005];
long long dis(ver p) { return 1ll * p.x * p.x + 1ll * p.y * p.y; }
bool cmp(ver x, ver y) { return dis(x) < dis(y); }
bool inr(int p) {
  if (v[p].y == 0) return v[p].x > 0;
  return v[p].y > 0;
}
bool cmp_r(int x, int y) {
  if (inr(x) == inr(y)) return v[x].x * v[y].y - v[x].y * v[y].x > 0;
  return inr(x) > inr(y);
}
int ans[10005], top, n, tot, now, tp;
ver res, re;
bool q;
long long ts;
int main() {
  for (int i = -199; i <= 199; ++i)
    for (int j = -199; j <= 199; ++j)
      if (i || j) v[++tot] = (ver){i, j};
  sort(v + 1, v + tot + 1, cmp);
  scanf("%d", &n);
  for (tp = 1; tp <= tot; ++tp) {
    if (dis(v[tp]) != dis(v[tp - 1])) ++now, ts += dis(v[tp]);
    if (now > n) break;
  }
  ts -= dis(v[tp]);
  --tp;
  if (ts & 1) {
    ++tp;
    ts += dis(v[tp]);
    for (; dis(v[tp + 1]) == dis(v[tp]); ++tp)
      ;
    q = 1;
  }
  for (; tp;) {
    if (q && !((dis(v[tp]) ^ ts) & 1)) {
      for (; dis(v[tp - 1]) == dis(v[tp]); --tp)
        ;
      --tp;
      q = 0;
      continue;
    }
    ++top;
    re = (ver){1000000, 1000000};
    do {
      if (dis(re) > dis(res + v[tp])) re = res + v[tp], ans[top] = tp;
      --tp;
    } while (dis(v[tp]) == dis(v[tp + 1]));
    res = re;
  }
  sort(ans + 1, ans + top + 1, cmp_r);
  re = (ver){0, 0};
  puts("YES");
  for (int i = 1; i <= top; ++i) {
    printf("%d %d\n", re.x, re.y);
    re = re + v[ans[i]];
  }
  return 0;
}
