//#pragma GCC optimize("Ofast", "unroll-loops")
//#pragma GCC target("sse", "sse2", "sse3", "ssse3", "sse4")
#ifdef __APPLE__
#include <iostream>
#include <cmath>
#include <algorithm>
#include <stdio.h>
#include <cstdint>
#include <cstring>
#include <string>
#include <cstdlib>
#include <vector>
#include <bitset>
#include <map>
#include <queue>
#include <ctime>
#include <stack>
#include <set>
#include <list>
#include <random>
#include <deque>
#include <functional>
#include <iomanip>
#include <sstream>
#include <fstream>
#include <complex>
#include <numeric>
#include <cassert>
#include <array>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <thread>
#else
#include <bits/stdc++.h>
#endif
#define all(a) a.begin(),a.end()
#define len(a) (int)(a.size())
#define mp make_pair
#define pb push_back
#define fir first
#define sec second
#define fi first
#define se second
using namespace std;
typedef pair<int, int> pii;
typedef long long ll;
typedef long double ld;
template<typename T>
bool umin(T &a, T b) {
if (b < a) {
a = b;
return true;
}
return false;
}
template<typename T>
bool umax(T &a, T b) {
if (a < b) {
a = b;
return true;
}
return false;
}
#if __APPLE__
#define D for (bool _FLAG = true; _FLAG; _FLAG = false)
#define LOG(...) print(#__VA_ARGS__" ::", __VA_ARGS__) << endl
template<class ...Ts>
auto &print(Ts ...ts) { return ((cerr << ts << " "), ...); }
#else
#define D while (false)
#define LOG(...)
#endif
const int max_n = -1, inf = 1000111222;
//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
vector<array<int, 6> > a[11];
void solve() {
int n;
cin >> n;
if(n < 8) {
cout << "No\n";
return;
}
cout << "Yes\n";
vector<array<int, 6> > ans;
vector<array<int, 6> > can_split;
int st_n = n;
while(st_n - 3 >= 8) st_n -= 3;
for(auto& x : a[st_n]) can_split.pb(x);
while(len(ans) + len(can_split) < n) {
auto cr = can_split.back(); can_split.pop_back();
pair<int, int> A = {cr[0], cr[1]}, B = {cr[2], cr[3]}, C = {cr[4], cr[5]};
if((A.fi + B.fi) % 2 || (A.se + B.se) % 2 || (C.fi + B.fi) % 2 || (C.se + B.se) % 2 || (A.fi + C.fi) % 2 || (A.se + C.se) % 2) {
ans.push_back(cr);
continue;
}
pair<int, int> AB = {(A.fi + B.fi) / 2, (A.se + B.se) / 2};
pair<int, int> BC = {(B.fi + C.fi) / 2, (B.se + C.se) / 2};
pair<int, int> CA = {(A.fi + C.fi) / 2, (A.se + C.se) / 2};
can_split.pb({A.fi, A.se, AB.fi, AB.se, CA.fi, CA.se});
can_split.pb({B.fi, B.se, AB.fi, AB.se, BC.fi, BC.se});
can_split.pb({C.fi, C.se, CA.fi, CA.se, BC.fi, BC.se});
can_split.pb({AB.fi, AB.se, BC.fi, BC.se, CA.fi, CA.se});
}
while(!can_split.empty()) {
auto cr = can_split.back(); can_split.pop_back();
for(auto& x : cr) cout << x << ' ';
cout << '\n';
}
while(!can_split.empty()) {
ans.pb(can_split.back());
can_split.pop_back();
}
for(auto& x : ans) {
for(auto& xx : x) cout << xx << ' ';
cout << '\n';
}
cout << '\n';
}
signed main() {
// freopen("input.txt", "r", stdin);
// freopen("output.txt", "w", stdout);
a[8].pb({0, 0, 9, 5, 0, 20});
a[8].pb({0, 20, 9, 5, 10, 20});
a[8].pb({10, 20, 9, 5, 11, 5});
a[8].pb({11, 5, 20, 20, 10, 20});
a[8].pb({11, 5, 20, 0, 20, 20});
a[8].pb({10, 0, 20, 0, 11, 5});
a[8].pb({10, 0, 9, 5, 11, 5});
a[8].pb({0, 0, 10, 0, 9, 5});
a[9].pb({0, 0, 14, 13, 0, 20});
a[9].pb({0, 20, 10, 15, 12, 20});
a[9].pb({12, 20, 10, 15, 15, 16});
a[9].pb({10, 15, 14, 13, 15, 16});
a[9].pb({15, 16, 12, 20, 20, 20});
a[9].pb({15, 16, 20, 20, 20, 14});
a[9].pb({14, 13, 15, 16, 20, 14});
a[9].pb({14, 13, 20, 0, 20, 14});
a[9].pb({0, 0, 20, 0, 14, 13});
a[10].pb({0, 0, 10, 5, 0, 20});
a[10].pb({0, 20, 10, 5, 20, 20});
a[10].pb({20, 0, 10, 5, 20, 20});
a[10].pb({0, 0, 8, 4, 9, 0});
a[10].pb({9, 0, 8, 4, 10, 1.5});
a[10].pb({10, 1.5, 10, 5, 8, 4});
a[10].pb({10, 1.5, 10, 5, 12, 4});
a[10].pb({11, 0, 10, 1.5, 12, 4});
a[10].pb({9, 0, 11, 0, 10, 1.5});
a[10].pb({11, 0, 12, 4, 20, 0});
for(int i = 8; i <= 10; i++) {
for(int j = 0; j < len(a[i]); j++)
for(auto& x : a[i][j])
x *= 1e9 / 20;
}
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int t = 1;
//cin >> t;
while (t--) solve();
}
/*
KIVI
*/