#include <bits/stdc++.h>
using namespace std;
int n, m, k;
pair<int, int> ps[1000005];
vector<pair<int, int>> v;
bool cmp(pair<int, int> a, pair<int, int> b) {
  return atan2(a.second, a.first) < atan2(b.second, b.first) - 1e-8;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i * i < 1000005; i++)
    for (int j = i, jj; (jj = i * i + j * j) < 1000005; j++) {
      ps[jj].first = i;
      ps[jj].second = j;
    }
  int s = 0;
  for (int i = 0; v.size() <= n; i++) {
    if (ps[i].first != 0 || ps[i].second != 0) {
      v.push_back(ps[i]);
      s += i;
    }
  }
  reverse(v.begin(), v.end());
  for (vector<pair<int, int>>::iterator it = v.begin(); it != v.end(); it++) {
    if ((s - (*it).first * (*it).first - (*it).second * (*it).second) % 2 ==
        0) {
      v.erase(it);
      break;
    }
  }
  int x = 0, y = 0, ny, nx, mx, my;
  for (vector<pair<int, int>>::iterator it = v.begin(); it != v.end(); it++) {
    mx = 1000005;
    my = 1000005;
    int dx = (*it).first;
    int dy = (*it).second;
    for (int i = 0; i < 2; i++) {
      for (int j = 0; j < 2; j++) {
        for (int k = 0; k < 2; k++) {
          nx = x + dx;
          ny = y + dy;
          if (abs(nx) + abs(ny) < abs(mx) + abs(my)) {
            mx = nx;
            my = ny;
            *it = make_pair(dx, dy);
          }
          dx = -dx;
        }
        dy = -dy;
      }
      swap(dx, dy);
    }
    x = mx;
    y = my;
  }
  x = 0;
  y = 0;
  puts("YES");
  sort(v.begin(), v.end(), cmp);
  for (vector<pair<int, int>>::iterator it = v.begin(); it != v.end(); it++) {
    printf("%d %d\n", x, y);
    x += (*it).first;
    y += (*it).second;
  }
  return 0;
}
