#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:32000000")
using namespace std;
struct S {
  int x, y;
  S(int x, int y) : x(x), y(y) {}
  friend bool operator<(const S &a, const S &b) {
    return a.x * a.x + a.y * a.y < b.x * b.x + b.y * b.y;
  }
  friend bool operator==(const S &a, const S &b) {
    return a.x * a.x + a.y * a.y == b.x * b.x + b.y * b.y;
  }
};
int n;
vector<S> w;
bool test(vector<pair<int, int> > &a) {
  sort(a.begin(), a.end());
  reverse(a.begin(), a.end());
  int s = 0;
  int n = ((int)a.size());
  for (int i = 0; i + 10 < n; i++) {
    if (s <= 0)
      s += a[i].first;
    else {
      s -= a[i].first;
      a[i].first *= -1;
    }
  }
  int k = min(10, n);
  for (int i = 0; i < (1 << k); i++) {
    int t = 0;
    for (int j = 0; j < k; j++)
      if (i & (1 << j))
        t -= a[n - 1 - j].first;
      else
        t += a[n - 1 - j].first;
    if (t == -s) {
      for (int j = 0; j < k; j++)
        if (i & (1 << j)) a[n - 1 - j].first *= -1;
      return true;
    }
  }
  return false;
}
bool cmp(const S &a, const S &b) {
  double u = atan2((double)a.y, (double)a.x);
  double v = atan2((double)b.y, (double)b.x);
  return u < v;
}
void solve() {
  scanf("%d", &n);
  for (int x = 0; x <= 170; x++)
    for (int y = 0; y < x; y++) w.push_back(S(x, y));
  sort(w.begin(), w.end());
  w.erase(unique(w.begin(), w.end()), w.end());
  int i = n;
  vector<S> a = w;
  int sumx = 0;
  int sumy = 0;
  for (int j = 0; j < i; j++) {
    sumx += a[j].x;
    sumy += a[j].y;
  }
  if (sumx % 2 != sumy % 2) {
    sumx = (sumx + a[i].x) % 2;
    sumy = (sumy + a[i].y) % 2;
    for (int j = 0; j < n; j++)
      if ((sumx + a[j].x) % 2 == (sumy + a[j].y) % 2) {
        swap(a[j], a[i]);
        break;
      }
    sumx = 0;
    sumy = 0;
    for (int j = 0; j < i; j++) {
      sumx += a[j].x;
      sumy += a[j].y;
    }
    if (sumx % 2 != sumy % 2) {
      throw 42;
    }
  }
  if (sumx % 2 == 1 && sumy % 2 == 1) {
    bool ok = false;
    for (int j = 0; j < n; j++)
      if (a[j].x % 2 != a[j].y % 2) {
        swap(a[j].x, a[j].y);
        ok = true;
        break;
      }
    if (!ok) {
      throw 42;
    }
  }
  vector<pair<int, int> > t;
  for (int j = 0; j < i; j++) t.push_back(make_pair(a[j].x, j));
  test(t);
  for (int j = 0; j < i; j++) a[t[j].second].x = t[j].first;
  t.clear();
  for (int j = 0; j < i; j++) t.push_back(make_pair(a[j].y, j));
  test(t);
  for (int j = 0; j < i; j++) a[t[j].second].y = t[j].first;
  {
    int sx = 0, sy = 0;
    for (int j = 0; j < i; j++) sx += a[j].x, sy += a[j].y;
    if (sx != 0 || sy != 0) throw 42;
  }
  int x = 0, y = 0;
  sort(a.begin(), a.begin() + i, cmp);
  printf("YES\n");
  for (int j = 0; j < i; j++) {
    printf("%d %d\n", x, y);
    x += a[j].x;
    y += a[j].y;
  }
}
int main() {
  solve();
  return 0;
}
