n=int(input())
a,b=map(int,input().split())
l=list(map(int,input().split()))
s=sum(l)
d=a+b 
def sgn(t):
    if t>0:return 1
    else:return -1
if s<d or s%2!=d%2 or (n==1 and s!=d) or max(l)>d+s-max(l):
    print('NO')
else:
    x,y=0,0
    q=[(0,0)]
    for v in l:
        aa=a-x
        bb=b-y
        d=abs(aa)+abs(bb)
        u=(s-d)//2
        if abs(bb)+u>=v:
            if v<=u:
                x=x-v*sgn(aa)
            else:
                x=x-u*sgn(aa)
                y=y+(v-u)*sgn(bb)
        elif abs(aa)+u>=v:
            if v<=u:
                y=y-v*sgn(bb)
            else:
                y=y-u*sgn(bb)
                x=x+(v-u)*sgn(aa)
        else:
            if v<=abs(aa)+u:
                x=x+v*sgn(aa)
            else:
                x=x+(abs(aa)+u)*sgn(aa)
                y=y+(v-(abs(aa)+u))*sgn(bb)
        q.append((x,y))
        s-=v
    print('YES')
    print('\n'.join(' '.join(str(j) for j in i) for i in q))