#include <bits/stdc++.h> using namespace std; int main() { cin.tie(0)->sync_with_stdio(0); int n; cin >> n; int64_t a, b; cin >> a >> b; vector<int64_t> d(n - 1); for (auto &di: d) cin >> di; int64_t sum = accumulate(d.begin(), d.end(), 0LL); if (sum < a + b) cout << "NO\n"; else { int64_t diff = sum - (a + b); if (diff % 2 == 1) { cout << "NO\n"; } else { cout << "YES\n"; cout << "0 0\n"; int64_t cur_dist = 0; int64_t x = 0, y = 0; int i = 0; while (true) { int di = d[i]; if (y - di <= -diff / 2) { y -= di; } else { break; } cout << x << " " << y << '\n'; i++; } x = y - d[i] + diff/2; y = -diff / 2; i++; cout << x << " " << y << '\n'; while (true) { int di = d[i]; if (x + di <= a) { x += di; } else { break; } cout << x << " " << y << '\n'; i++; } y = x + d[i] - a; x = a; i++; cout << x << " " << y << '\n'; while (true) { y += d[i]; i++; cout << x << " " << y << '\n'; } cout << a << " " << b << '\n'; } } return 0; }