#include <bits/stdc++.h>
using namespace std;
template <typename T>
void usort(vector<T> &x) {
  sort((x).begin(), (x).end());
  x.erase(unique((x).begin(), (x).end()), x.end());
}
template <typename T>
int index(const vector<T> &a, const T &x) {
  return lower_bound((x).begin(), (x).end(), x) - a.begin();
}
template <typename T>
T sq(const T &x) {
  return x * x;
}
inline int qd(const pair<int, int> &a) {
  if ((a.second) > 0) return 0;
  if ((a.second) == 0 && (a.first) > 0) return 0;
  return 1;
}
bool cmp_len(const pair<int, int> &a, const pair<int, int> &b) {
  return sq((a.first)) + sq((a.second)) < sq((b.first)) + sq((b.second));
}
bool cmp_cross(const pair<int, int> &a, const pair<int, int> &b) {
  return atan2(a.second, a.first) < atan2(b.second, b.first) - 1e-8;
}
int main() {
  vector<pair<int, int> > p;
  for (int i = 0; i < (301); ++i) {
    for (int j = i; j <= 300; j++) {
      if (i | j) p.push_back(make_pair(i, j));
    }
  }
  sort((p).begin(), (p).end(), cmp_len);
  int n;
  scanf("%d", &n);
  vector<pair<int, int> > ans(n);
  int t = 1;
  for (int i = 1; i < ((int)(p).size()); i++) {
    if (cmp_len(p[i - 1], p[i])) p[t++] = p[i];
  }
  int sum = 0;
  for (int i = 0; i < (n); ++i) sum += (p[i].first) + (p[i].second);
  if (sum & 1) {
    for (int i = n - 1; i >= 0; i--) {
      if ((((p[i].first) + (p[i].second)) & 1) ^
          (((p[n].first) + (p[n].second)) & 1)) {
        p.erase(p.begin() + i);
        break;
      }
    }
  }
  int x = 0;
  int y = 0;
  for (int i = n - 1; i >= 0; i--) {
    int nx = 1e9, ny = 1e9;
    for (int t = 1; t >= -1; t -= 2)
      for (int q = 1; q >= -1; q -= 2) {
        int mx = x + p[i].first * t, my = y + p[i].second * q;
        if ((long long)mx * mx + (long long)my * my <
            (long long)nx * nx + (long long)ny * ny) {
          ans[i].first = p[i].first * t;
          ans[i].second = p[i].second * q;
          nx = mx;
          ny = my;
        }
        mx = x + p[i].second * t;
        my = y + p[i].first * q;
        if ((long long)mx * mx + (long long)my * my <
            (long long)nx * nx + (long long)ny * ny) {
          ans[i].first = p[i].second * t;
          ans[i].second = p[i].first * q;
          nx = mx;
          ny = my;
        }
      }
    x += ans[i].first;
    y += ans[i].second;
  }
  sort((ans).begin(), (ans).end(), cmp_cross);
  puts("YES");
  for (int i = 0; i < (n); ++i) {
    printf("%d %d\n", x, y);
    x += (ans[i].first);
    y += (ans[i].second);
  }
  return 0;
}
