#include <algorithm>
#include <cassert>
#include <iostream>
#include <vector>

struct Line {
	long long a, b, l, r;
};

std::pair<int, std::pair<int, int>> intersection(const Line& l1, const Line& l2) {
	long long a = l1.a;
	long long b = l1.b;
	long long c = l2.a;
	long long d = l2.b;
	if (a - c == 0) {
		if (d - b != 0) {
			return std::make_pair(false, std::make_pair(0, 0));
		}
		if (l1.l <= l2.l && l2.l <= l1.r) {
			long long x = l2.l;
			assert(l1.a * x + l1.b == l2.a * x + l2.b);
			return std::make_pair(true, std::make_pair(x, l1.a * x + l1.b));
		}
		if (l1.l <= l2.r && l2.r <= l1.r) {
			long long x = l2.r;
			assert(l1.a * x + l1.b == l2.a * x + l2.b);
			return std::make_pair(true, std::make_pair(x, l1.a * x + l1.b));
		}
		if (l2.l <= l1.l && l1.l <= l2.r) {
			long long x = l1.l;
			assert(l1.a * x + l1.b == l2.a * x + l2.b);
			return std::make_pair(true, std::make_pair(x, l1.a * x + l1.b));
		}
		if (l2.l <= l1.r && l1.r <= l2.r) {
			long long x = l1.r;
			assert(l1.a * x + l1.b == l2.a * x + l2.b);
			return std::make_pair(true, std::make_pair(x, l1.a * x + l1.b));
		}
		return std::make_pair(false, std::make_pair(0, 0));
	}
	if ((d - b) % (a - c) != 0) {
		assert(false);
		return std::make_pair(false, std::make_pair(0, 0));
	}
	long long x = (d - b) / (a - c);
	if (l1.l <= x && x <= l1.r && l2.l <= x && x <= l2.r) {
		assert(l1.a * x + l1.b == l2.a * x + l2.b);
		return std::make_pair(true, std::make_pair(x, l1.a * x + l1.b));
	}
	return std::make_pair(false, std::make_pair(0, 0));
};

int main() {
	int n;
	std::cin >> n;

	long long a, b;
	std::cin >> a >> b;

	std::vector<long long> d(n - 1);
	std::vector<int> order(n - 1);

	int parity = (a + b) % 2;

	for (int i = 0; i < n - 1; ++i) {
		std::cin >> d[i];
		parity = (parity + d[i]) % 2;
		order[i] = i;
	}

	if (parity % 2 == 1) {
		std::cout << "NO" << '\n';
		return 0;
	}

	std::sort(order.begin(), order.end(), [&](int i, int j) {
		return d[i] > d[j];
	});

	long long d1 = 0;
	long long d2 = 0;

	std::vector<int> v1, v2;

	for (int i : order) {
		if (d1 <= d2) {
			v1.push_back(i);
			d1 += d[i];
		}
		else {
			v2.push_back(i);
			d2 += d[i];
		}
	}

	if (d1 + d2 < a + b) {
		std::cout << "NO" << '\n';
		return 0;
	}

	std::vector<Line> vl1, vl2;

	vl1.push_back({1, d1, -d1, 0});
	vl1.push_back({1, -d1, 0, d1});
	vl1.push_back({-1, d1, 0, d1});
	vl1.push_back({-1, -d1, -d1, 0});

	vl2.push_back({1, d2 + b - a, a - d2, a});
	vl2.push_back({1, -d2 + b - a, a, a + d2});
	vl2.push_back({-1, d2 + b + a, a, a + d2});
	vl2.push_back({-1, -d2 + b + a, a - d2, a});

	bool found = false;
	long long tx = 0;
	long long ty = 0;

	//std::cout << d1 << ' ' << d2 << '\n';

	for (const Line& l1 : vl1) {
		for (const Line& l2 : vl2) {
			auto [ok, point] = intersection(l1, l2);
			if (ok) {
				found = true;
				tx = point.first;
				ty = point.second;
				//assert(l1.a * tx + l1.b == ty);
				//assert(l2.a * tx + l2.b == ty);
				//assert(l1.l <= tx && tx <= l1.r);
				//assert(l2.l <= tx && tx <= l2.r);
			}
		}
	}

	if (!found) {
		std::cout << "NO" << '\n';
		return 0;
	}

	std::cout << "YES" << '\n';

	//std::cout << tx << ' ' << ty << '\n';

	std::vector<std::pair<int, int>> ans(n - 1, std::make_pair(0, 0));

	long long cur_x = 0;
	long long cur_y = 0;

	for (int i : v1) {
		int cnt1 = 0;
		if (cur_x < tx) {
			long long p = std::min(d[i], tx - cur_x);
			cur_x += p;
			d[i] -= p;
			cnt1 += 1;
			ans[i].first = p;
		}
		if (cur_x > tx) {
			long long p = std::min(d[i], cur_x - tx);
			cur_x -= p;
			d[i] -= p;
			cnt1 += 1;
			ans[i].first = -p;
		}
		int cnt2 = 0;
		if (cur_y < ty) {
			long long p = std::min(d[i], ty - cur_y);
			cur_y += p;
			d[i] -= p;
			cnt2 += 1;
			ans[i].second = p;
		}
		if (cur_y > ty) {
			long long p = std::min(d[i], cur_y - ty);
			cur_y -= p;
			d[i] -= p;
			cnt2 += 1;
			ans[i].second = -p;
		}
		//assert(cnt1 <= 1);
		//assert(cnt2 <= 1);
		//assert(d[i] == 0);
	}

	cur_x = a;
	cur_y = b;

	for (int i : v2) {
		int cnt1 = 0;
		if (cur_x < tx) {
			long long p = std::min(d[i], tx - cur_x);
			cur_x += p;
			d[i] -= p;
			cnt1 += 1;
			ans[i].first = -p;
		}
		if (cur_x > tx) {
			long long p = std::min(d[i], cur_x - tx);
			cur_x -= p;
			d[i] -= p;
			cnt1 += 1;
			ans[i].first = p;
		}
		int cnt2 = 0;
		if (cur_y < ty) {
			long long p = std::min(d[i], ty - cur_y);
			cur_y += p;
			d[i] -= p;
			cnt2 += 1;
			ans[i].second = -p;
		}
		if (cur_y > ty) {
			long long p = std::min(d[i], cur_y - ty);
			cur_y -= p;
			d[i] -= p;
			cnt2 += 1;
			ans[i].second = p;
		}
		//assert(cnt1 <= 1);
		//assert(cnt2 <= 1);
		//assert(d[i] == 0);
	}

	cur_x = 0;
	cur_y = 0;

	std::cout << 0 << ' ' << 0 << '\n';

	for (int i = 0; i < n - 1; ++i) {
		cur_x += ans[i].first;
		cur_y += ans[i].second;
		std::cout << cur_x << ' ' << cur_y << '\n';
	}

	//assert(cur_x == a);
	//assert(cur_y == b);

	return 0;
}