def f(x1, y1, x2, y2, x3, y3, x4, y4): if x1 == x2 and x3 == x4: if x1 != x3: return None a, b = sorted([y1, y2]) c, d = sorted([y3, y4]) if min(b, d) >= max(a, c): return (x1, min(b, d)) else: return None if y1 == y2 and y3 == y4: if y1 != y3: return None a, b = sorted([x1, x2]) c, d = sorted([x3, x4]) if min(b, d) >= max(a, c): return (min(b, d), y1) else: return None if x1 == x2: p, q = x1, y3 if min(y1, y2) <= q <= max(y1, y2) and min(x3, x4) <= p <= max(x3, x4): return (p, q ) return None p, q = x3, y1 if min(y3, y4) <= q <= max(y3, y4) and min(x1, x2) <= p <= max(x1, x2): return (p, q ) return None def gensquare(cx, cy, r): # (x + y, x - y) a = (cx + r + cy, cx + r - cy) b = (cx + cy + r, cx - cy - r) c = (cx - r + cy, cx - r - cy) d = (cx + cy - r, cx - cy + r) return [(a, b), (b, c), (c, d), (d, a)] def square(cx1, cy1, r1, cx2, cy2, r2): a, b = gensquare(cx1, cy1, r1), gensquare(cx2, cy2, r2) for l1 in a: for l2 in b: res = f(*l1[0], *l1[1], *l2[0], *l2[1]) if res is not None: p, q = res return ((p + q) // 2, (p - q) // 2) return None n = int(input()) a, b = map(int, input().split()) d = [*map(int, input().split())] r = d + [0] s = sum(d) if s % 2 != (a + b) % 2 or s < a + b or max(d) > (s + a + b) // 2: print('NO') else: print('YES') print(0, 0) x = y = 0 for i in d: r = r[1:] r2 = max(0, 2 * max(r) - sum(r)) #print(x, y, i, a, b, r2) if (x + y + a + b + i + r2) % 2: r2 += 1 res = square(x, y, i, a, b, r2) if res is not None: x, y = res print(x, y) else: r2 = sum(r) if (x + y + a + b + i + r2) % 2: r2 -= 1 res = square(x, y, i, a, b, r2) if res is not None: x, y = res print(x, y) else: x += i print(x ,y)