An integer sequence is called beautiful if the difference between any two consecutive numbers is equal to $1$. More formally, a sequence $s_1, s_2, \ldots, s_{n}$ is beautiful if $|s_i - s_{i+1}| = 1$ for all $1 \leq i \leq n - 1$.

Trans has $a$ numbers $0$, $b$ numbers $1$, $c$ numbers $2$ and $d$ numbers $3$. He wants to construct a beautiful sequence using all of these $a + b + c + d$ numbers.

However, it turns out to be a non-trivial task, and Trans was not able to do it. Could you please help Trans?


-----Input-----

The only input line contains four non-negative integers $a$, $b$, $c$ and $d$ ($0 < a+b+c+d \leq 10^5$).


-----Output-----

If it is impossible to construct a beautiful sequence satisfying the above constraints, print "NO" (without quotes) in one line.

Otherwise, print "YES" (without quotes) in the first line. Then in the second line print $a + b + c + d$ integers, separated by spaces — a beautiful sequence. There should be $a$ numbers equal to $0$, $b$ numbers equal to $1$, $c$ numbers equal to $2$ and $d$ numbers equal to $3$.

If there are multiple answers, you can print any of them.


-----Examples-----
Input
2 2 2 1

Output
YES
0 1 0 1 2 3 2

Input
1 2 3 4

Output
NO

Input
2 2 2 3

Output
NO



-----Note-----

In the first test, it is easy to see, that the sequence is beautiful because the difference between any two consecutive numbers is equal to $1$. Also, there are exactly two numbers, equal to $0$, $1$, $2$ and exactly one number, equal to $3$.

It can be proved, that it is impossible to construct beautiful sequences in the second and third tests.

Difficulty: HARD
Tags: Greedy algorithms

Complete search

Constructive algorithms
Skill types: Complete search

Greedy algorithms

Starter code:

Solutions:
(a, b, c, d) = [int(x) for x in input().split()]
dn = {0: a, 1: b, 2: c, 3: d}
total = a + b + c + d
flag = 1
for i in range(4):
	if dn[i] == 0:
		continue
	soln = []
	soln.append(i)
	td = dn.copy()
	td[i] -= 1
	last = i
	for j in range(total - 1):
		if td.get(last - 1, 0):
			soln.append(last - 1)
			td[last - 1] -= 1
			last = last - 1
		elif td.get(last + 1, 0):
			soln.append(last + 1)
			td[last + 1] -= 1
			last = last + 1
		else:
			break
	if len(soln) == total:
		print('YES')
		for i in soln:
			print(i, end=' ')
		print()
		flag = 0
		break
if flag:
	print('NO')


import sys
readline = sys.stdin.readline

def check(A, B, C, D):
	N = A + B + C + D
	if not (A + C == N // 2 or A + C == -(-N // 2)):
		return False
	even = [2] * C + [0] * A
	odd = [3] * D + [1] * B
	ans = [None] * N
	flag = B + D == -(-N // 2)
	for i in range(N):
		if (i % 2 == 0) == flag:
			ans[i] = odd[i // 2]
		else:
			ans[i] = even[i // 2]
	if all((abs(a2 - a1) == 1 for (a1, a2) in zip(ans, ans[1:]))):
		return ans
	return False
(A, B, C, D) = map(int, readline().split())
ans = check(A, B, C, D)
if ans == False:
	print('NO')
else:
	print('YES')
	print(*ans)


def sexy(a):
	a.append(0)
	k = sum(a)
	b = a[:]
	s0 = []
	s1 = []
	i = 0
	j = 1
	c = 0
	while True:
		if c % 2 == 0:
			while a[i] == 0 and i < 4:
				i += 1
			if i == 4:
				break
			if i == j:
				i += 1
				while a[i] == 0 and i < 4:
					i += 1
				if i == 4:
					break
			s0.append(i)
			a[i] -= 1
		else:
			while a[j] == 0 and j < 4:
				j += 1
			if j == 4:
				break
			if i == j:
				j += 1
				while a[j] == 0 and j < 4:
					j += 1
				if j == 4:
					break
			s0.append(j)
			a[j] -= 1
		c += 1
	i = 1
	j = 0
	c = 0
	while True:
		if c % 2 == 0:
			while b[i] == 0 and i < 4:
				i += 1
			if i == 4:
				break
			if i == j:
				i += 1
				while b[i] == 0 and i < 4:
					i += 1
				if i == 4:
					break
			s1.append(i)
			b[i] -= 1
		else:
			while b[j] == 0 and j < 4:
				j += 1
			if j == 4:
				break
			if i == j:
				j += 1
				while b[j] == 0 and j < 4:
					j += 1
				if j == 4:
					break
			s1.append(j)
			b[j] -= 1
		c += 1
	if k == 1:
		print('YES')
		return [s0 if len(s0) == 1 else s1, True]
	ok1 = True
	ok2 = True
	for i in range(1, len(s0)):
		if abs(s0[i] - s0[i - 1]) != 1:
			ok1 = False
			break
	if len(s0) != k:
		ok1 = False
	for i in range(1, len(s1)):
		if abs(s1[i] - s1[i - 1]) != 1:
			ok2 = False
			break
	if len(s1) != k:
		ok2 = False
	if ok1:
		print('YES')
		return [s0, True]
	elif ok2:
		print('YES')
		return [s1, True]
	else:
		return [[], False]

def main():
	a = list(map(int, input().split()))
	b = a[:]
	p = sexy(b)
	if p[1]:
		print(*p[0])
		return
	else:
		a = a[::-1]
		p = sexy(a)
		if not p[1]:
			print('NO')
			return
		for i in range(len(p[0])):
			p[0][i] = 3 - p[0][i]
		print(*p[0])
	return
main()


a = list(map(int, input().split()))
s = a[0] + a[1] + a[2] + a[3]
out = []
if s == 1:
	for i in range(4):
		if a[i] > 0:
			print('YES')
			print(i)
			return
for i in range(3):
	(fst, snd) = (i, i + 1)
	if a[fst] == a[snd]:
		check = True
		for j in range(4):
			if j != fst and j != snd:
				if a[j] != 0:
					check = False
		if check:
			out = [i, i + 1] * a[fst]
			print('YES')
			print(' '.join(list(map(str, out))))
			return
	if a[fst] == a[snd] + 1:
		check = True
		for j in range(4):
			if j != fst and j != snd:
				if a[j] != 0:
					check = False
		if check:
			out = [i, i + 1] * a[snd] + [i]
			print('YES')
			print(' '.join(list(map(str, out))))
			return
	if a[fst] + 1 == a[snd]:
		check = True
		for j in range(4):
			if j != fst and j != snd:
				if a[j] != 0:
					check = False
		if check:
			out = [i + 1] + [i, i + 1] * a[fst]
			print('YES')
			print(' '.join(list(map(str, out))))
			return
if a[1] < a[0]:
	print('NO')
	return
if a[2] < a[3]:
	print('NO')
	return
left = [0, 1] * a[0]
right = [2, 3] * a[3]
a[1] -= a[0]
a[2] -= a[3]
if a[1] == a[2] + 1:
	out = [1] + left + [2, 1] * a[2] + right
	print('YES')
	print(' '.join(list(map(str, out))))
	return
if a[1] == a[2]:
	out = left + [2, 1] * a[1] + right
	print('YES')
	print(' '.join(list(map(str, out))))
	return
if a[1] + 1 == a[2]:
	out = left + [2, 1] * a[1] + right + [2]
	print('YES')
	print(' '.join(list(map(str, out))))
	return
print('NO')
return


(n0, n1, n2, n3) = map(int, input().split())
num = []
if n0 - n1 >= 2 or n3 - n2 >= 2:
	print('NO')
	exit(0)
t1 = n1 - n0
t2 = n2 - n3
if t1 == -1:
	if n2 == 0 and n3 == 0:
		print('YES')
		for i in range(n1):
			print('0 1', end=' ')
		print(0)
		exit(0)
	else:
		print('NO')
		exit(0)
if t2 == -1:
	if n0 == 0 and n1 == 0:
		print('YES')
		for i in range(n2):
			print('3 2', end=' ')
		print(3)
		exit(0)
	else:
		print('NO')
		exit(0)
if t1 == t2:
	print('YES')
	for i in range(n0):
		print('0 1', end=' ')
	for i in range(t1):
		print('2 1', end=' ')
	for i in range(n3):
		print('2 3', end=' ')
	print('')
elif t1 == t2 + 1:
	print('YES')
	for i in range(n0):
		print('1 0', end=' ')
	print(1, end=' ')
	for i in range(t2):
		print('2 1', end=' ')
	for i in range(n3):
		print('2 3', end=' ')
elif t1 + 1 == t2:
	print('YES')
	for i in range(n0):
		print('0 1', end=' ')
	for i in range(t1):
		print('2 1', end=' ')
	for i in range(n3):
		print('2 3', end=' ')
	print(2)
else:
	print('NO')
	exit(0)


h = list(map(int, input().split()))
s = sum(h)
for i in range(4):
	u = h[:]
	if not h[i]:
		continue
	ans = []
	ans.append(i)
	u[i] -= 1
	cur = i
	for i in range(s - 1):
		if cur - 1 >= 0 and u[cur - 1]:
			cur -= 1
			u[cur] -= 1
			ans.append(cur)
		elif cur + 1 <= 3 and u[cur + 1]:
			cur += 1
			u[cur] -= 1
			ans.append(cur)
		else:
			break
	if len(ans) == s:
		print('YES')
		print(*ans)
		exit()
print('NO')


(a, b, c, d) = map(int, input().split())
if a > b + 1 or b > a + c + 1 or c > b + d + 1 or (d > c + 1):
	print('NO')
else:
	d1 = d
	d2 = d
	L1 = ['k']
	L2 = ['k']
	for i in range(a):
		L1.append(0)
		L1.append('k')
		L2.append(0)
		L2.append('k')
	for i in range(c):
		L1.append(2)
		L1.append('k')
		L2.append(2)
		L2.append('k')
	ptr1 = 0
	for i in range(b):
		if ptr1 >= len(L1):
			break
		L1[ptr1] = 1
		ptr1 += 2
	for i in range(ptr1, len(L1), 2):
		L1[i] = 3
		d1 -= 1
	ptr2 = 2
	for i in range(b):
		if ptr2 >= len(L2):
			break
		L2[ptr2] = 1
		ptr2 += 2
	for i in range(ptr2, len(L2), 2):
		L2[i] = 3
		d2 -= 1
	if len(L1) > 0 and L1[-1] == 'k' or d1 == -1:
		L1 = L1[:len(L1) - 1]
	if len(L1) > 0 and L1[0] == 'k':
		L1 = L1[1:]
	if len(L2) > 0 and L2[-1] == 'k' or d2 == -1:
		L2 = L2[:len(L2) - 1]
	if len(L2) > 0 and L2[0] == 'k':
		L2 = L2[1:]
	flag = 0
	if L1.count(0) != a or L1.count(1) != b or L1.count(2) != c or (L1.count(3) != d) or (L1.count('k') > 0):
		flag = 1
	if flag == 0:
		for i in range(0, len(L1) - 1):
			if abs(L1[i] - L1[i + 1]) != 1:
				flag = 1
				break
	if flag == 0:
		print('YES')
		print(*L1)
	else:
		if L2.count(0) != a or L2.count(1) != b or L2.count(2) != c or (L2.count(3) != d) or (L2.count('k') > 0):
			flag = 2
		if flag == 1:
			for i in range(0, len(L2) - 1):
				if abs(L2[i] - L2[i + 1]) != 1:
					flag = 2
					break
		if flag == 1:
			print('YES')
			print(*L2)
	if flag == 2:
		print('NO')


a = list(map(int, input().split()))
ref = [0, 1, 2, 3]
x = sum(a)
for i in range(4):
	b = a[:]
	res = []
	for j in range(x):
		b[i] -= 1
		res.append(ref[i])
		if i == 0:
			i = 1
		elif i == 3:
			i = 2
		elif i == 1:
			if b[0] > 0:
				i = 0
			else:
				i = 2
		elif b[3] > 0:
			i = 3
		else:
			i = 1
	if max(b) == 0 and min(b) == 0:
		print('YES')
		print(*res)
		exit()
print('NO')


(a, b, c, d) = map(int, input().split())
if not -1 <= a + c - b - d <= 1:
	print('NO')
	exit()
if a + b and d - c > 0 or (c + d and a - b > 0):
	print('NO')
	exit()
if not a + b:
	ansls = [2] * (c > d) + [3, 2] * min(c, d) + [3] * (d > c)
	print('YES')
	print(*ansls)
elif not c + d:
	ansls = [1] * (b > a) + [0, 1] * min(a, b) + [0] * (a > b)
	print('YES')
	print(*ansls)
elif a and a + c >= b + d:
	ansls = [0, 1] * (a - 1) + [0]
	b -= a - 1
	if b:
		ansls.extend([1, 2] * (b - 1) + [1])
		c -= b - 1
		if c:
			ansls.extend([2, 3] * (c - 1) + [2])
			d -= c - 1
			if d:
				ansls.append(3)
	print('YES')
	print(*ansls)
elif d and b + d >= a + c:
	ansls = [3, 2] * (d - 1) + [3]
	c -= d - 1
	if c:
		ansls.extend([2, 1] * (c - 1) + [2])
		b -= c - 1
		if b:
			ansls.extend([1, 0] * (b - 1) + [1])
			a -= b - 1
			if a:
				ansls.append(0)
	print('YES')
	print(*ansls)
elif a:
	ansls = [1, 0] * a
	b -= a
	if b:
		ansls.extend([1, 2] * c)
		b -= c
		if b:
			ansls.append(1)
	print('YES')
	print(*ansls)
elif d:
	ansls = [2, 3] * d
	c -= d
	if c:
		ansls.extend([2, 1] * b)
		c -= b
		if c:
			ansls.append(2)
	print('YES')
	print(*ansls)
else:
	ansls = [1] * (b > c) + [2, 1] * min(b, c) + [2] * (c > b)
	print('YES')
	print(*ansls)


import sys
import math, bisect
sys.setrecursionlimit(10 ** 5)
from itertools import groupby, accumulate
from heapq import heapify, heappop, heappush
from collections import deque, Counter, defaultdict
I = lambda : int(sys.stdin.readline())
neo = lambda : map(int, sys.stdin.readline().split())
Neo = lambda : list(map(int, sys.stdin.readline().split()))

def check(A, t):
	s = '1' * b + '3' * d
	j = 0
	for i in range(len(A)):
		if (i + t) % 2 == 0:
			A[i] = int(s[j])
			j += 1
	for i in range(1, len(A)):
		if abs(A[i] - A[i - 1]) != 1:
			return 0
	return 1
(a, b, c, d) = neo()
t = a + c + 1
Ans = [-1] * (a + c + t)
s = '0' * a + '2' * c
j = 0
for i in range(len(Ans)):
	if i % 2:
		Ans[i] = int(s[j])
		j += 1
if d + b == a + c - 1:
	A = Ans[1:-1]
	f = check(A, 1)
	if f:
		print('YES')
		print(*A)
	else:
		print('NO')
	exit()
elif d + b == a + c:
	B = Ans[1:]
	C = Ans[:-1]
	f = check(B, 1)
	if f:
		print('YES')
		print(*B)
		exit()
	f = check(C, 0)
	if f:
		print('YES')
		print(*C)
		exit()
	print('NO')
	exit()
elif d + b == a + c + 1:
	D = Ans[:]
	f = check(D, 0)
	if f:
		print('YES')
		print(*D)
		exit()
	print('NO')
	exit()
print('NO')


str1 = input()

def go(x):
	s = [int(i) for i in str1.split()]
	res = []
	while sum(s) > 0:
		res.append(x)
		s[x] -= 1
		if s[x] < 0:
			return
		if x == 0:
			x = 1
		elif x == 1:
			if s[0] < s[1] or s[0] == 0:
				x = 2
			else:
				x = 0
		elif x == 2:
			if s[3] < s[2] or s[3] == 0:
				x = 1
			else:
				x = 3
		elif x == 3:
			x = 2
	return res
for start in range(4):
	r = go(start)
	if r:
		print('YES')
		print(*r)
		break
else:
	print('NO')


import sys
ip = lambda : sys.stdin.readline().rstrip()
(a, b, c, d) = map(int, ip().split())
ans = [-1] * (a + b + c + d)
if a - b > 1 or d - c > 1:
	print('NO')
elif a - b == 1:
	if c or d:
		print('NO')
	else:
		print('YES')
		print('0 1 ' * b, end='')
		print('0')
elif d - c == 1:
	if a or b:
		print('NO')
	else:
		print('YES')
		print('3 2 ' * c, end='')
		print('3')
else:
	(ct1, ct2) = (b - a, c - d)
	if abs(ct1 - ct2) > 1:
		print('NO')
		sys.exit(0)
	else:
		print('YES')
	end = ''
	if ct1 > ct2:
		print('1 ', end='')
		ct1 -= 1
	elif ct2 > ct1:
		end = '2'
	print('0 1 ' * a, end='')
	print('2 1 ' * ct1, end='')
	print('2 3 ' * d, end='')
	print(end)


import sys

def main():
	(a, b, c, d) = get_ints()
	if a + b + c + d == 1:
		print('YES')
		if a == 1:
			print(0)
			return
		if b == 1:
			print(1)
			return
		if c == 1:
			print(2)
			return
		if d == 1:
			print(3)
			return

	def quit():
		print('NO')
		exit(0)
	ans = []
	if b > a:
		ans.append(1)
		b -= 1
	while a > 0 and b > 0:
		ans.append(0)
		ans.append(1)
		a -= 1
		b -= 1
	if a > 0 and c != 0 and (d != 0):
		quit()
	while b > 0 and c > 0:
		ans.append(2)
		ans.append(1)
		c -= 1
		b -= 1
	if b > 0:
		quit()
	if c == 0 and d != 0:
		quit()
	while c > 0 and d > 0:
		ans.append(2)
		ans.append(3)
		c -= 1
		d -= 1
	if c:
		ans.append(2)
		c -= 1
	if c == 1 and ans[0] == 1:
		ans.insert(0, 2)
		c -= 1
	if d == 1 and ans[0] == 2:
		ans.insert(0, 3)
		d -= 1
	if a == 1 and b == 0 and (c == 0) and (d == 0):
		a -= 1
		ans.append(0)
	for i in range(1, len(ans)):
		if abs(ans[i - 1] - ans[i]) != 1:
			quit()
	if a or b or c or d:
		quit()
	print('YES')
	print(*ans)
get_array = lambda : list(map(int, sys.stdin.readline().split()))
get_ints = lambda : map(int, sys.stdin.readline().split())
input = lambda : sys.stdin.readline().strip()
main()


import sys
input = sys.stdin.buffer.readline
from collections import defaultdict

def getlist():
	return list(map(int, input().split()))

def main():
	(a, b, c, d) = getlist()
	if abs(a + c - b - d) > 1:
		print('NO')
		return
	if c == 0 and d == 0:
		if a == b + 1:
			ans = []
			for i in range(b):
				ans.append('0')
				ans.append('1')
			ans.append('0')
			judge = 'YES'
			print(judge)
			print(' '.join(ans))
			return
	if a == 0 and b == 0:
		if c + 1 == d:
			ans = []
			for i in range(c):
				ans.append('3')
				ans.append('2')
			ans.append('3')
			judge = 'YES'
			print(judge)
			print(' '.join(ans))
			return
	if a > b:
		print('NO')
		return
	if c < d:
		print('NO')
		return
	judge = 'NO'
	if a + c == b + d + 1:
		judge = 'YES'
		print(judge)
		ans = []
		for i in range(a):
			ans.append('0')
			ans.append('1')
		for i in range(b - a):
			ans.append('2')
			ans.append('1')
		for i in range(d):
			ans.append('2')
			ans.append('3')
		ans.append('2')
		print(' '.join(ans))
		return
	if a + c + 1 == b + d:
		judge = 'YES'
		print(judge)
		ans = []
		for i in range(d):
			ans.append('3')
			ans.append('2')
		for i in range(c - d):
			ans.append('1')
			ans.append('2')
		for i in range(a):
			ans.append('1')
			ans.append('0')
		ans.append('1')
		print(' '.join(ans))
		return
	if a + c == b + d:
		judge = 'YES'
		print(judge)
		ans = []
		for i in range(a):
			ans.append('0')
			ans.append('1')
		for i in range(b - a):
			ans.append('2')
			ans.append('1')
		for i in range(d):
			ans.append('2')
			ans.append('3')
		print(' '.join(ans))
		return
	print(judge)
main()


from sys import stdin

def rl():
	return [int(w) for w in stdin.readline().split()]
(a, b, c, d) = rl()

class Fail(Exception):
	pass

def go(x):
	s = [a, b, c, d]
	r = []
	while sum(s) > 0:
		r.append(x)
		s[x] -= 1
		if s[x] < 0:
			return
		if x == 0:
			x = 1
		elif x == 1:
			if s[0] < s[1] or s[0] == 0:
				x = 2
			else:
				x = 0
		elif x == 2:
			if s[3] < s[2] or s[3] == 0:
				x = 1
			else:
				x = 3
		elif x == 3:
			x = 2
	return r
for start in range(4):
	r = go(start)
	if r:
		print('YES')
		print(*r)
		break
else:
	print('NO')


import sys
import math
from collections import defaultdict
(a, b, c, d) = map(int, sys.stdin.readline().split())
if a == 0 and b == 0:
	if d - c == 1:
		ans = [0 for _ in range(c + d)]
		i = 0
		while i < 2 * c:
			ans[i] = 3
			ans[i + 1] = 2
			i += 2
		ans[2 * c] = 3
		print('YES')
		print(*ans)
		sys.exit()
	if c - d == 1:
		ans = [0 for _ in range(c + d)]
		i = 0
		while i < 2 * d:
			ans[i] = 2
			ans[i + 1] = 3
			i += 2
		ans[2 * d] = 2
		print('YES')
		print(*ans)
		sys.exit()
	if c == d:
		ans = [0 for _ in range(c + d)]
		i = 0
		while i < 2 * c:
			ans[i] = 2
			ans[i + 1] = 3
			i += 2
		print('YES')
		print(*ans)
		sys.exit()
	print('NO')
	sys.exit()
if c == 0 and d == 0:
	if b - a == 1:
		ans = [0 for _ in range(a + b)]
		i = 0
		while i < 2 * a:
			ans[i] = 1
			ans[i + 1] = 0
			i += 2
		ans[2 * a] = 1
		print('YES')
		print(*ans)
		sys.exit()
	if a - b == 1:
		ans = [0 for _ in range(a + b)]
		i = 0
		while i < 2 * b:
			ans[i] = 0
			ans[i + 1] = 1
			i += 2
		ans[2 * b] = 0
		print('YES')
		print(*ans)
		sys.exit()
	if a == b:
		ans = [0 for _ in range(a + b)]
		i = 0
		while i < 2 * b:
			ans[i] = 0
			ans[i + 1] = 1
			i += 2
		print('YES')
		print(*ans)
		sys.exit()
	print('NO')
	sys.exit()
if a > b or d > c:
	print('NO')
	sys.exit()
ans = [0 for _ in range(a + b + c + d)]
s = '01' * a
s2 = '23' * d
rem1 = b - a
rem2 = c - d
if abs(rem1 - rem2) > 1:
	print('NO')
	sys.exit()
s3 = '21' * min(rem1, rem2)
if rem1 < rem2:
	s2 = s2 + '2'
elif rem2 < rem1:
	s = '1' + s
final = s + s3 + s2
for i in range(a + b + c + d):
	ans[i] = final[i]
print('YES')
print(*ans)
sys.exit()


import sys
from sys import stdin, stdout

def ispossible(a, b, c, d):
	if b >= a - 1 and c >= d - 1 and (b - a == c - d or b - a + 1 == c - d or b - a == c - d + 1):
		return True
	else:
		return False
A = stdin.readline().strip().split()
a = int(A[0])
b = int(A[1])
c = int(A[2])
d = int(A[3])
if not ispossible(a, b, c, d):
	print('NO')
	sys.exit()
res = []
rng = a + b + c + d
pre = -1
for i in range(a + b + c + d):
	if (pre == 1 or pre == -1) and a > 0 and ispossible(a - 1, b, c, d):
		a -= 1
		res.append(0)
		pre = 0
	elif (pre == 0 or pre == 2 or pre == -1) and b > 0 and ispossible(a, b - 1, c, d):
		b -= 1
		res.append(1)
		pre = 1
	elif (pre == 1 or pre == 3 or pre == -1) and c > 0 and ispossible(a, b, c - 1, d):
		c -= 1
		res.append(2)
		pre = 2
	elif (pre == 2 or pre == -1) and d > 0 and ispossible(a, b, c, d - 1):
		d -= 1
		res.append(3)
		pre = 3
	else:
		print('NO')
		sys.exit()
print('YES')
print(' '.join(map(str, res)))


(a, b, c, d) = [int(x) for x in input().split()]
n = a + b + c + d
if a > b + 1 or d > c + 1:
	print('NO')
elif a == b + 1:
	if c > 0 or d > 0:
		print('NO')
	else:
		ls = [0, 1] * b + [0]
		print('YES')
		print(*ls)
elif d == c + 1:
	if a > 0 or b > 0:
		print('NO')
	else:
		ls = [3, 2] * c + [3]
		print('YES')
		print(*ls)
else:
	ls1 = [0, 1] * a
	ls2 = [2, 3] * d
	b -= a
	c -= d
	if b == c:
		print('YES')
		print(*ls1, *[2, 1] * c, *ls2)
	elif b > c:
		if b == c + 1:
			print('YES')
			print(1, *ls1, *[2, 1] * c, *ls2)
		else:
			print('NO')
	elif c == b + 1:
		print('YES')
		print(*ls1, *[2, 1] * b, *ls2, 2)
	else:
		print('NO')


(a, b, c, d) = map(int, input().split())
for st in range(4):
	list = [a, b, c, d]
	path = []
	while True:
		if list[st] == 0:
			break
		list[st] -= 1
		path.append(st)
		if st == 0:
			st = 1
		elif st == 3:
			st = 2
		elif st == 1:
			if list[0] == 0:
				st += 1
			else:
				st = 0
		elif list[3] == 0:
			st -= 1
		else:
			st += 1
	if max(list) == 0:
		print('YES')
		for i in range(len(path)):
			print(path[i], end='')
			if i != len(path) - 1:
				print(' ', end='')
			else:
				print('')
		exit(0)
print('NO')


import os
import sys
import math
from io import BytesIO, IOBase
from fractions import Fraction
import collections
from itertools import permutations
from collections import defaultdict
from collections import deque
import threading
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

class Factorial:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorials = [1, 1]
		self.invModulos = [0, 1]
		self.invFactorial_ = [1, 1]

	def calc(self, n):
		if n <= -1:
			print('Invalid argument to calculate n!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.factorials):
			return self.factorials[n]
		nextArr = [0] * (n + 1 - len(self.factorials))
		initialI = len(self.factorials)
		prev = self.factorials[-1]
		m = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * i % m
		self.factorials += nextArr
		return self.factorials[n]

	def inv(self, n):
		if n <= -1:
			print('Invalid argument to calculate n^(-1)')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		p = self.MOD
		pi = n % p
		if pi < len(self.invModulos):
			return self.invModulos[pi]
		nextArr = [0] * (n + 1 - len(self.invModulos))
		initialI = len(self.invModulos)
		for i in range(initialI, min(p, n + 1)):
			next = -self.invModulos[p % i] * (p // i) % p
			self.invModulos.append(next)
		return self.invModulos[pi]

	def invFactorial(self, n):
		if n <= -1:
			print('Invalid argument to calculate (n^(-1))!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.invFactorial_):
			return self.invFactorial_[n]
		self.inv(n)
		nextArr = [0] * (n + 1 - len(self.invFactorial_))
		initialI = len(self.invFactorial_)
		prev = self.invFactorial_[-1]
		p = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * self.invModulos[i % p] % p
		self.invFactorial_ += nextArr
		return self.invFactorial_[n]

class Combination:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorial = Factorial(MOD)

	def ncr(self, n, k):
		if k < 0 or n < k:
			return 0
		k = min(k, n - k)
		f = self.factorial
		return f.calc(n) * f.invFactorial(max(n - k, k)) * f.invFactorial(min(k, n - k)) % self.MOD
(a, b, c, d) = map(int, input().split())
x1 = b - a
x2 = c - d
if b == 0 and a == 0 and (abs(c - d) <= 1):
	if c <= d:
		print('YES')
		if d == 1 and c == 0:
			ans = [3]
		else:
			ans = [3, 2] * c + [3] * (d - c)
		print(*ans)
	else:
		print('YES')
		if c == 1 and d == 0:
			ans = [2]
		else:
			ans = [2, 3] * d + [2] * (c - d)
		print(*ans)
elif c == 0 and d == 0 and (abs(a - b) <= 1):
	if a <= b:
		print('YES')
		if b == 1 and a == 0:
			ans = [1]
		else:
			ans = [1, 0] * a + [1] * (b - a)
		print(*ans)
	else:
		print('YES')
		if a == 1 and b == 0:
			ans = [0]
		else:
			ans = [0, 1] * b + [0] * (a - b)
		print(*ans)
elif b < a or c < d:
	print('NO')
elif a == b and c == d:
	print('YES')
	ans = [0, 1] * a + [2, 3] * c
	print(*ans)
elif x1 == x2:
	print('YES')
	ans = [1, 0] * a + [1, 2] * x1 + [3, 2] * d
	print(*ans)
elif x1 == x2 + 1:
	print('YES')
	ans = [1] + [0, 1] * a + [2, 1] * x2 + [2, 3] * d
	print(*ans)
elif x1 + 1 == x2:
	print('YES')
	ans = [0, 1] * a + [2, 1] * x1 + [2, 3] * d + [2]
	print(*ans)
else:
	print('NO')


import sys
import math
from collections import defaultdict, Counter, deque
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
for i in range(1):
	(a, b, c, d) = map(int, input().split())
	if a > b:
		if c > 0 or d > 0 or a - b > 1:
			print('NO')
		else:
			print('YES')
			ans = [0] + [1, 0] * b
			print(*ans)
		continue
	if a == b:
		ans = [0, 1] * a
		a = 0
	else:
		ans = [1] + [0, 1] * a
		a = b - a - 1
	b = c
	if a >= b and a != 0:
		if d > 0 or a > b:
			print('NO')
		else:
			print('YES')
			ans += [2, 1] * a
			print(*ans)
		continue
	ans += [2, 1] * a
	a = b - a
	b = d
	if b > a:
		if ans or b - a > 1:
			print('NO')
		else:
			print('YES')
			ans = [3] + [2, 3] * a
			print(*ans)
		continue
	elif a - b > 1:
		if ans and ans[0] == 1:
			a -= 1
			ans += [2, 1]
			ans = ans[1:]
		if a - b > 1:
			print('NO')
			continue
	print('YES')
	ans += [2, 3] * b
	a -= b
	if a:
		ans += [2]
	print(*ans)


import sys
readline = sys.stdin.readline
readlines = sys.stdin.readlines
ns = lambda : readline().rstrip()
ni = lambda : int(readline().rstrip())
nm = lambda : map(int, readline().split())
nl = lambda : list(map(int, readline().split()))
prn = lambda x: print(*x, sep='\n')

def solve():
	g = nl()
	n = sum(g)
	for i in range(4):
		x = i
		f = g[:]
		l = list()
		while True:
			if not f[x]:
				break
			f[x] -= 1
			l.append(x)
			if x in (0, 3) or f[x ^ 1]:
				x ^= 1
			else:
				x = 3 - x
		if len(l) == n:
			print('YES')
			print(*l)
			break
	else:
		print('NO')
	return
solve()


from sys import stdin
from collections import deque
mod = 10 ** 9 + 7
from bisect import bisect_right
from bisect import bisect_left
from collections import defaultdict
from math import sqrt, factorial, gcd, log2, inf, ceil
(a, b, c, d) = map(int, input().split())
n = a + b + c + d
g = [a, b, c, d]
g.sort()
if g[0] == 0 and g[1] == 0 and (g[2] == 0) and (g[3] != 1):
	print('NO')
	exit()
if n == 1:
	print('YES')
	print(*[0 * a + 1 * b + 2 * c + 3 * d])
	exit()
ans = []
if a == 0 and b == 0 and (abs(c - d) == 1):
	if c >= d:
		for i in range(n):
			if i % 2 == 0:
				ans.append(2)
			else:
				ans.append(3)
	else:
		for i in range(n):
			if i % 2 == 0:
				ans.append(3)
			else:
				ans.append(2)
	print('YES')
	print(*ans)
	exit()
if c == 0 and d == 0 and (abs(a - b) == 1):
	if a >= b:
		for i in range(n):
			if i % 2 == 0:
				ans.append(0)
			else:
				ans.append(1)
	else:
		for i in range(n):
			if i % 2 == 0:
				ans.append(1)
			else:
				ans.append(0)
	print('YES')
	print(*ans)
	exit()
if a >= 0:
	if a == b:
		ans = []
		for i in range(2 * a):
			if i % 2 == 0:
				ans.append(0)
			else:
				ans.append(1)
		b -= a
		cnt = 0
		while True:
			if c == 0 or d == 0:
				break
			if cnt % 2 == 0:
				ans.append(2)
				c -= 1
			else:
				ans.append(3)
				d -= 1
			cnt += 1
		if ans[-1] == 3:
			if c == 1:
				c -= 1
				ans.append(2)
		if ans[-1] == 2:
			if d == 1:
				ans.append(3)
				d -= 1
		if ans[-1] == 1 and c != 0:
			c -= 1
			ans.append(2)
		if c == 0 and d == 0:
			print('YES')
			print(*ans)
		else:
			print('NO')
	elif b > a:
		ans = [1]
		b -= 1
		for i in range(2 * a):
			if i % 2 == 0:
				ans.append(0)
			else:
				ans.append(1)
		b -= a
		cnt = 0
		while True:
			if b == 0 or c == 0:
				break
			if cnt % 2 == 0:
				ans.append(2)
				c -= 1
			if cnt % 2 != 0:
				ans.append(1)
				b -= 1
			cnt += 1
		if ans[-1] == 1 and c == 0 and (b == 0):
			if d != 0:
				print('NO')
				exit()
			print('YES')
			print(*ans)
		elif ans[-1] == 1 and b == 0:
			cnt = 0
			while True:
				if c == 0 or d == 0:
					break
				if cnt % 2 == 0:
					ans.append(2)
					c -= 1
				else:
					ans.append(3)
					d -= 1
				cnt += 1
			if c == 0 and d == 0:
				print('YES')
				print(*ans)
			elif c == 1 and d == 0:
				print('YES')
				print(*[2] + ans)
			elif c == 2 and d == 0:
				print('YES')
				print(*[2] + ans + [2])
			elif c == 0 and d == 1:
				print('YES')
				print(*ans + [3])
			else:
				print('NO')
		elif ans[-1] == 2 and b == 1 and (d != 0):
			print('NO')
		elif ans[-1] == 2 and b == 1 and (d == 0):
			print('YES')
			print(*ans + [1])
		elif ans[-1] == 2 and b == 0:
			cnt = 0
			while True:
				if c == 0 or d == 0:
					break
				if cnt % 2 != 0:
					ans.append(2)
					c -= 1
				else:
					ans.append(3)
					d -= 1
				cnt += 1
			if c == 0 and d == 0:
				print('YES')
				print(*ans)
			elif c == 1 and d == 0:
				print('YES')
				print(*[2] + ans)
			elif c == 0 and d == 1:
				print('YES')
				print(*ans + [3])
			elif c == 2 and d == 0:
				print('YES')
				print(*[2] + ans + [2])
			else:
				print('NO')
		else:
			print('NO')
	elif b == 1 and a == 2 and (c == 0) and (d == 0):
		print('YES')
		print(*[0, 1, 0])
	else:
		print('NO')


import sys, math
import io, os
from bisect import bisect_left as bl, bisect_right as br, insort
from heapq import heapify, heappush, heappop
from collections import defaultdict as dd, deque, Counter

def data():
	return sys.stdin.readline().strip()

def mdata():
	return list(map(int, data().split()))

def outl(var):
	sys.stdout.write(' '.join(map(str, var)) + '\n')

def out(var):
	sys.stdout.write(str(var) + '\n')
from decimal import Decimal
mod = int(1000000000.0) + 7
INF = 10 ** 8
(a, b, c, d) = mdata()
ans = []
if a + (1 if c or d else 0) - b > 1 or d + (1 if a or b else 0) - c > 1 or abs(a + c - b - d) > 1:
	out('NO')
	exit()
if a + c - b < d and b:
	ans.append(1)
	b -= 1
for i in range(min(a, b)):
	ans.append(0)
	ans.append(1)
if a > b:
	ans.append(0)
b -= min(a, b)
for i in range(min(b, c)):
	ans.append(2)
	ans.append(1)
c -= b
for i in range(min(d, c)):
	ans.append(2)
	ans.append(3)
if c > d:
	ans.append(2)
elif d > c:
	ans = [3] + ans
out('YES')
outl(ans)


(a, b, c, d) = [int(x) for x in input().split()]
res = [0 for _ in range(a)]
res += [2 for _ in range(c)]
if a + c < b + d:
	ind = 0
else:
	ind = 1
while b > 0:
	res.insert(ind, 1)
	ind += 2
	b -= 1
while d > 0:
	res.insert(ind, 3)
	ind += 2
	d -= 1
tr = True
for i in range(1, len(res)):
	if abs(res[i - 1] - res[i]) != 1:
		print('NO')
		tr = False
		break
if tr:
	print('YES')
	print(*res)


import sys
(a, b, c, d) = map(int, input().split())
x = []
y = []
for i in range(a):
	x.append(0)
for i in range(b):
	y.append(1)
for i in range(c):
	x.append(2)
for i in range(d):
	y.append(3)
p = []
if len(x) < len(y):
	(x, y) = (y, x)
i = 0
j = 0
if len(x) != len(y):
	p.append(x[0])
	j += 1
	(x, y) = (y, x)
while i < len(x) and j < len(y):
	p.append(x[i])
	p.append(y[j])
	i += 1
	j += 1
if len(p) != a + b + c + d:
	print('NO')
	sys.exit(0)
for t in range(len(p) - 1):
	if p[t] - p[t + 1] != 1 and p[t] - p[t + 1] != -1:
		print('NO')
		sys.exit(0)
print('YES')
print(*p)


import sys

def Solve1(A, s, t):
	seq = list(range(s, t + 1))
	for i in seq:
		A[i] -= 1
	if any((A[i] < 0 for i in range(4))):
		return None
	if any((A[i] > 0 for i in range(4))):
		lo = min((i for i in range(4) if A[i] > 0))
		hi = max((i for i in range(4) if A[i] > 0))
		if any((A[i] == 0 for i in range(lo, hi))):
			return None
		k = s
		while k > lo:
			if A[k - 1] == 0 or A[k] == 0:
				return None
			j = seq.index(k)
			seq[j:j] = [k, k - 1]
			A[k] -= 1
			A[k - 1] -= 1
			k -= 1
		k = t
		while k < hi:
			if A[k] == 0 or A[k + 1] == 0:
				return None
			j = seq.index(k)
			seq[j:j] = [k, k + 1]
			A[k] -= 1
			A[k + 1] -= 1
			k += 1
	ops = [0, 0, 0]
	ops[0] = A[0]
	ops[1] = A[1] - ops[0]
	ops[2] = A[2] - ops[1]
	for x in ops:
		if x < 0:
			return None
	if ops[2] != A[3]:
		return None
	ans = []
	for x in seq:
		ans.append(x)
		if x < 3 and ops[x] > 0:
			ans.extend([x + 1, x] * ops[x])
			ops[x] = 0
		elif x > 0 and ops[x - 1] > 0:
			ans.extend([x - 1, x] * ops[x - 1])
			ops[x - 1] = 0
	return ans

def Solve(A):
	if A[1] == 0 and A[0] > 0 and (A[2] + A[3] > 0):
		return None
	if A[2] == 0 and A[3] > 0 and (A[0] + A[1] > 0):
		return None
	for s in range(4):
		for t in range(s, 4):
			att = Solve1(A[:], s, t)
			if att is not None:
				return att
	return None

def SolvePrint(A):
	ans = Solve(A)
	if ans is None:
		print('NO')
	else:
		print('YES')
		print(' '.join((str(x) for x in ans)))

def Test():
	for i in range(10000):
		t = i
		a = []
		for _ in range(4):
			a.append(t % 10)
			t //= 10
		print(a, end=': ')
		SolvePrint(a)
	print('Done')

def Main():
	A = list(map(int, sys.stdin.readline().split()))
	SolvePrint(A)
Main()


import sys

def rint():
	return map(int, sys.stdin.readline().split())

def input():
	return sys.stdin.readline().rstrip('\n')

def oint():
	return int(input())
(a, b, c, d) = rint()
tot = a + b + c + d
ans = []
if a > b + 1 or d > c + 1:
	print('NO')
	exit()
if a == b + 1:
	if c != 0 or d != 0:
		print('NO')
		exit()
	print('YES')
	for i in range(tot):
		ans.append(i % 2)
	print(*ans)
	exit()
if d == c + 1:
	if a != 0 or b != 0:
		print('NO')
		exit()
	print('YES')
	for i in range(tot):
		ans.append((i + 1) % 2 + 2)
	print(*ans)
	exit()
while a > 0:
	ans.append(0)
	ans.append(1)
	a -= 1
	b -= 1
ans2 = []
while d > 0:
	ans2.append(2)
	ans2.append(3)
	d -= 1
	c -= 1
ans3 = []
while b > 0 and c > 0:
	ans3.append(2)
	ans3.append(1)
	b -= 1
	c -= 1
if b > 1 or c > 1:
	print('NO')
	exit()
if b == 1:
	ans = [1] + ans
if c == 1:
	ans2 = ans2 + [2]
ans4 = ans + ans3 + ans2
print('YES')
print(*ans4)


from copy import deepcopy
arr = list(map(int, input().split()))
s = sum(arr)
for i in range(4):
	brr = deepcopy(arr)
	if not arr[i]:
		continue
	ans = []
	ans.append(i)
	brr[i] -= 1
	cur = i
	for i in range(s - 1):
		if cur <= 2 and brr[cur + 1]:
			cur += 1
			brr[cur] -= 1
			ans.append(cur)
		elif cur >= 1 and brr[cur - 1]:
			cur -= 1
			brr[cur] -= 1
			ans.append(cur)
		else:
			break
	if len(ans) == s:
		print('YES')
		print(*ans)
		exit()
print('NO')


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
from math import factorial
from collections import Counter, defaultdict
from heapq import heapify, heappop, heappush

def RL():
	return map(int, sys.stdin.readline().rstrip().split())

def RLL():
	return list(map(int, sys.stdin.readline().rstrip().split()))

def N():
	return int(input())

def comb(n, m):
	return factorial(n) / (factorial(m) * factorial(n - m)) if n >= m else 0

def perm(n, m):
	return factorial(n) // factorial(n - m) if n >= m else 0

def mdis(x1, y1, x2, y2):
	return abs(x1 - x2) + abs(y1 - y2)

def ctd(chr):
	return ord(chr) - ord('a')
mod = 998244353
INF = float('inf')

def main():
	tarr = RLL()
	for tag in range(4):
		arr = tarr.copy()
		sm = sum(arr)
		res = []
		while sm and tag < 4:
			if arr[tag] == 0:
				break
			arr[tag] -= 1
			sm -= 1
			res.append(tag)
			if tag - 1 > -1 and arr[tag - 1] > 0:
				tag -= 1
			else:
				tag += 1
		if sm == 0:
			print('YES')
			print(*res)
			exit()
	else:
		print('NO')
main()


from sys import stdin

def iinput():
	return int(stdin.readline())

def sinput():
	return input()

def minput():
	return map(int, stdin.readline().split())

def linput():
	return list(map(int, stdin.readline().split()))
a = linput()
ref = [0, 1, 2, 3]
x = sum(a)
for i in range(4):
	b = a[:]
	seq = []
	for j in range(x):
		b[i] -= 1
		seq.append(ref[i])
		if i == 0:
			i = 1
		elif i == 3:
			i = 2
		elif i == 1:
			if b[0] > 0:
				i = 0
			else:
				i = 2
		elif b[3] > 0:
			i = 3
		else:
			i = 1
	if max(b) == 0 and min(b) == 0:
		print('YES')
		print(*seq)
		exit()
print('NO')


def printit(s):
	print('YES')
	print(*s)
	exit()

def solve(j, i):
	tt = sum(j)
	jj = []
	for nn in j:
		jj.append(nn)
	s = []
	while 1:
		if i == 4 or jj[i] == 0:
			break
		s.append(i)
		jj[i] -= 1
		if i > 0 and jj[i - 1] > 0:
			i -= 1
		else:
			i += 1
	if len(s) == tt:
		printit(s)
l = list(map(int, input().split()))
for i in range(0, 4):
	solve(l, i)
print('NO')


(a, b, c, d) = [int(x) for x in input().split(' ')]
if abs(a + c - b - d) > 1:
	print('NO')
elif d > c:
	if d - c > 1:
		print('NO')
	elif a != 0 or b != 0:
		print('NO')
	else:
		print('YES')
		for i in range(c):
			print(3, 2, sep=' ', end=' ')
		print(3)
elif a > b:
	if a - b > 1:
		print('NO')
	elif c != 0 or d != 0:
		print('NO')
	else:
		print('YES')
		for i in range(b):
			print(0, 1, sep=' ', end=' ')
		print(0)
else:
	print('YES')
	if a + c >= b + d:
		for i in range(a):
			print(0, 1, sep=' ', end=' ')
		for i in range(b - a):
			print(2, 1, sep=' ', end=' ')
		for i in range(d):
			print(2, 3, sep=' ', end=' ')
		for i in range(a + c - b - d):
			print(2)
	else:
		print(1, end=' ')
		for i in range(a):
			print(0, 1, sep=' ', end=' ')
		for i in range(b - a - 1):
			print(2, 1, sep=' ', end=' ')
		for i in range(d):
			print(2, 3, sep=' ', end=' ')


from sys import stdin, stdout, setrecursionlimit
from math import floor, gcd, fabs, factorial, fmod, sqrt, inf, log
from random import seed, randint
from datetime import datetime
from collections import defaultdict as dd, deque
from heapq import merge, heapify, heappop, heappush, nsmallest
from bisect import bisect_left as bl, bisect_right as br, bisect
from collections import defaultdict as dd
mod = pow(10, 9) + 7
mod2 = 998244353

def inp():
	return stdin.readline().strip()

def iinp():
	return int(inp())

def out(var, end='\n'):
	stdout.write(str(var) + '\n')

def outa(*var, end='\n'):
	stdout.write(' '.join(map(str, var)) + end)

def lmp():
	return list(mp())

def mp():
	return map(int, inp().split())

def smp():
	return map(str, inp().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(m, val) for j in range(n)]

def remadd(x, y):
	return 1 if x % y else 0

def ceil(a, b):
	return (a + b - 1) // b

def def_value():
	return 0
a = lmp()
a = [0] + a + [0]
b = a.copy()
n = sum(a)
f2 = False
for kkk in range(4):
	a = b.copy()
	if a[kkk + 1] > 0:
		ans = l1d(n, -1)
		ans[0] = kkk
		a[kkk + 1] -= 1
		i = 1
		flg = False
		while i < n:
			if a[ans[i - 1]] > 0:
				ans[i] = ans[i - 1] - 1
				a[ans[i - 1]] -= 1
			elif a[ans[i - 1] + 2] > 0:
				ans[i] = ans[i - 1] + 1
				a[ans[i - 1] + 2] -= 1
			else:
				flg = True
				break
			i += 1
		if not flg:
			print('YES')
			print(*ans)
			f2 = True
			break
if not f2:
	print('NO')


import sys
input = sys.stdin.readline
(a, b, c, d) = map(int, input().split())
n = a + b + c + d
res = [-1] * n
if a + c + 1 == b + d:
	for i in range(0, 2 * b - 1, 2):
		res[i] = 1
	for i in range(2 * b, n, 2):
		res[i] = 3
	for i in range(1, n, 2):
		if (res[i - 1], res[i + 1]) == (1, 1):
			if a > 0:
				res[i] = 0
				a -= 1
			elif c > 0:
				res[i] = 2
				c -= 1
			else:
				print('NO')
				exit()
		elif (res[i - 1], res[i + 1]) == (1, 3):
			if c > 0:
				res[i] = 2
				c -= 1
			else:
				print('NO')
				exit()
		elif c > 0:
			res[i] = 2
			c -= 1
		else:
			print('NO')
			exit()
	print('YES')
	print(*res)
elif a + c == b + d + 1:
	for i in range(0, 2 * a - 1, 2):
		res[i] = 0
	for i in range(2 * a, n, 2):
		res[i] = 2
	for i in range(1, n, 2):
		if (res[i - 1], res[i + 1]) == (0, 0):
			if b > 0:
				res[i] = 1
				b -= 1
			else:
				print('NO')
				exit()
		elif (res[i - 1], res[i + 1]) == (0, 2):
			if b > 0:
				res[i] = 1
				b -= 1
			else:
				print('NO')
				exit()
		elif d > 0:
			res[i] = 3
			d -= 1
		elif b > 0:
			res[i] = 1
			b -= 1
		else:
			print('NO')
			exit()
	print('YES')
	print(*res)
elif a + c == b + d:
	for i in range(0, 2 * a - 1, 2):
		res[i] = 0
	for i in range(2 * a, n, 2):
		res[i] = 2
	for i in range(1, n - 1, 2):
		if (res[i - 1], res[i + 1]) == (0, 0):
			if b > 0:
				res[i] = 1
				b -= 1
			else:
				print('NO')
				exit()
		elif (res[i - 1], res[i + 1]) == (0, 2):
			if b > 0:
				res[i] = 1
				b -= 1
			else:
				print('NO')
				exit()
		elif d > 0:
			res[i] = 3
			d -= 1
		elif b > 0:
			res[i] = 1
			b -= 1
		else:
			print('NO')
			exit()
	if c > 0:
		if d > 0:
			res[-1] = 3
		elif b > 0:
			res[-1] = 1
		else:
			print('NO')
			exit()
	elif b > 0:
		res[-1] = 1
	else:
		print('NO')
		exit()
	print('YES')
	print(*res)
else:
	print('NO')


3
import os
import sys

def main():
	(A, B, C, D) = read_ints()
	ans = solve(A, B, C, D)
	if ans:
		print('YES')
		print(*ans)
	else:
		print('NO')

def solve(A, B, C, D):
	S = A + B + C + D
	for l in range(4):
		for r in range(4):
			ans = build([A, B, C, D], S, l, r)
			if ans:
				return ans
	return None

def build(A, S, l, r):
	if A[l] == 0:
		return None
	ans = [l]
	A[l] -= 1
	i = l
	S -= 1
	while S > 0:
		if i == 0:
			j = 1
		elif i == 1:
			if A[0] == 0:
				j = 2
			elif A[2] == 0:
				j = 0
			elif r <= 1:
				j = 2
			else:
				j = 0
		elif i == 2:
			if A[3] == 0:
				j = 1
			elif A[1] == 0:
				j = 3
			elif r >= 2:
				j = 1
			else:
				j = 3
		else:
			j = 2
		A[j] -= 1
		S -= 1
		ans.append(j)
		if A[j] < 0:
			return None
		i = j
	return ans
DEBUG = 'DEBUG' in os.environ

def inp():
	return sys.stdin.readline().rstrip()

def read_int():
	return int(inp())

def read_ints():
	return [int(e) for e in inp().split()]

def dprint(*value, sep=' ', end='\n'):
	if DEBUG:
		print(*value, sep=sep, end=end)

def __starting_point():
	main()
__starting_point()


(a, b, c, d) = map(int, input().split())
x1 = b - a
x2 = c - d
if b == 0 and a == 0 and (abs(c - d) <= 1):
	if c <= d:
		print('YES')
		if d == 1 and c == 0:
			ans = [3]
		else:
			ans = [3, 2] * c + [3] * (d - c)
		print(*ans)
	else:
		print('YES')
		if c == 1 and d == 0:
			ans = [2]
		else:
			ans = [2, 3] * d + [2] * (c - d)
		print(*ans)
elif c == 0 and d == 0 and (abs(a - b) <= 1):
	if a <= b:
		print('YES')
		if b == 1 and a == 0:
			ans = [1]
		else:
			ans = [1, 0] * a + [1] * (b - a)
		print(*ans)
	else:
		print('YES')
		if a == 1 and b == 0:
			ans = [0]
		else:
			ans = [0, 1] * b + [0] * (a - b)
		print(*ans)
elif b < a or c < d:
	print('NO')
elif a == b and c == d:
	print('YES')
	ans = [0, 1] * a + [2, 3] * c
	print(*ans)
elif x1 == x2:
	print('YES')
	ans = [1, 0] * a + [1, 2] * x1 + [3, 2] * d
	print(*ans)
elif x1 == x2 + 1:
	print('YES')
	ans = [1] + [0, 1] * a + [2, 1] * x2 + [2, 3] * d
	print(*ans)
elif x1 + 1 == x2:
	print('YES')
	ans = [0, 1] * a + [2, 1] * x1 + [2, 3] * d + [2]
	print(*ans)
else:
	print('NO')


(a, b, c, d) = list(map(int, input().split()))
try:
	assert abs(a - b + c - d) < 2
	ans = []
	if not d:
		ans = [1, 0] * a + [1, 2] * c
		if a + c < b:
			ans.append(1)
		if a + c > b:
			ans.pop(0)
	elif not a:
		ans = [2, 3] * d + [2, 1] * b
		if d + b < c:
			ans.append(2)
		if d + b > c:
			ans.pop(0)
	elif a + c > b + d:
		while a:
			ans.append(0)
			ans.append(1)
			a -= 1
			b -= 1
		assert b >= 0
		while b:
			ans.append(2)
			ans.append(1)
			b -= 1
			c -= 1
		assert c >= 0
		while c:
			ans.append(2)
			ans.append(3)
			c -= 1
			d -= 1
		ans.pop()
	else:
		while d:
			ans.append(3)
			ans.append(2)
			c -= 1
			d -= 1
		assert c >= 0
		while c:
			ans.append(1)
			ans.append(2)
			b -= 1
			c -= 1
		assert b >= 0
		while b:
			ans.append(1)
			ans.append(0)
			a -= 1
			b -= 1
		if a:
			ans.pop()
	print('YES')
	print(*ans)
except AssertionError:
	print('NO')


import sys
input = sys.stdin.readline
(a, b, c, d) = map(int, input().split())
for start in range(4):
	ANS = []
	now = start
	A = [a, b, c, d]
	if A[now] == 0:
		continue
	while True:
		A[now] -= 1
		ANS.append(now)
		if now == 0:
			if A[1] != 0:
				now = 1
			else:
				break
		elif now == 1:
			if A[0] != 0:
				now = 0
			elif A[2] != 0:
				now = 2
			else:
				break
		elif now == 2:
			if A[3] != 0:
				now = 3
			elif A[1] != 0:
				now = 1
			else:
				break
		elif A[2] != 0:
			now = 2
		else:
			break
	if max(A) == 0:
		print('YES')
		print(*ANS)
		sys.exit()
print('NO')


def solve1(arr, start):
	wynik = []
	id = start
	while True:
		if arr[id] == 0:
			if sum(arr) == 0:
				break
			return 'NO\n'
		arr[id] -= 1
		wynik.append(str(id))
		if id == 0:
			id = 1
		elif id == 1:
			id = 0 if arr[0] > 0 else 2
		elif id == 2:
			id = 1 if arr[1] > 0 else 3
		elif id == 3:
			id = 2
	return 'YES\n' + ' '.join(wynik)

def solve():
	arr = [int(a) for a in input().split(' ')]
	res = ''
	for i in range(4):
		res = solve1(arr.copy(), i)
		if not res.startswith('NO'):
			break
	return res
print(solve())


import copy
inp = [int(i) for i in input().split()]
sum = 0
for i in inp:
	sum += i
for i in range(4):
	if inp[i] != 0:
		ans = []
		tmp = copy.copy(inp)
		ans.append(i)
		tmp[i] -= 1
		pointer = i
		for j in range(sum - 1):
			if pointer != 0 and tmp[pointer - 1] > 0:
				ans.append(pointer - 1)
				tmp[pointer - 1] -= 1
				pointer -= 1
			elif pointer != 3 and tmp[pointer + 1] > 0:
				ans.append(pointer + 1)
				tmp[pointer + 1] -= 1
				pointer += 1
			else:
				break
		if len(ans) == sum:
			print('YES')
			print(*ans)
			exit(0)
print('NO')
exit(0)


import sys
reader = (map(int, line.split()) for line in sys.stdin)
input = reader.__next__

def beatSeq(a, b, c, d):
	left = []
	while a > 0 and b > 0:
		left.append(0)
		left.append(1)
		a -= 1
		b -= 1
	if a > 1:
		return None
	elif a == 1:
		if c + d > 0:
			return None
		else:
			left.append(0)
			return left
	right = []
	while d > 0 and c > 0:
		right.append(3)
		right.append(2)
		d -= 1
		c -= 1
	if d > 1:
		return None
	elif d == 1:
		if left or a + b > 0:
			return None
		else:
			right.append(3)
			return right
	while b > 0 and c > 0:
		left.append(2)
		left.append(1)
		b -= 1
		c -= 1
	if max(b, c) > 1:
		return None
	elif b > 0:
		left = [1] + left
	elif c > 0:
		right = [2] + right
	return left + [r for r in reversed(right)]
(a, b, c, d) = input()
ans = beatSeq(a, b, c, d)
if ans is None:
	print('NO')
else:
	print('YES')
	print(*ans)


from sys import stdin, stdout
from math import floor, gcd, fabs, factorial, fmod, sqrt, inf, log
from collections import defaultdict as dd, deque
from heapq import merge, heapify, heappop, heappush, nsmallest
from bisect import bisect_left as bl, bisect_right as br, bisect
mod = pow(10, 9) + 7
mod2 = 998244353

def inp():
	return stdin.readline().strip()

def iinp():
	return int(inp())

def out(var, end='\n'):
	stdout.write(str(var) + '\n')

def outa(*var, end='\n'):
	stdout.write(' '.join(map(str, var)) + end)

def lmp():
	return list(mp())

def mp():
	return map(int, inp().split())

def smp():
	return map(str, inp().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(m, val) for j in range(n)]

def remadd(x, y):
	return 1 if x % y else 0

def ceil(a, b):
	return (a + b - 1) // b

def isprime(x):
	if x <= 1:
		return False
	if x in (2, 3):
		return True
	if x % 2 == 0:
		return False
	for i in range(3, int(sqrt(x)) + 1, 2):
		if x % i == 0:
			return False
	return True
(a, b, c, d) = mp()
if (a + c) % 2 != (b + d) % 2:
	if abs(a + c - b - d) != 1:
		print('NO')
	else:
		if a + c > b + d:
			ml = []
			n = a + b + c + d
			for i in range(n):
				if i % 2:
					if b > 0:
						ml.append(1)
						b -= 1
					else:
						ml.append(3)
				elif a > 0:
					ml.append(0)
					a -= 1
				else:
					ml.append(2)
		else:
			ml = []
			n = a + b + c + d
			for i in range(n):
				if i % 2 == 0:
					if b > 0:
						ml.append(1)
						b -= 1
					else:
						ml.append(3)
				elif a > 0:
					ml.append(0)
					a -= 1
				else:
					ml.append(2)
		t = True
		for i in range(1, n):
			if ml[i] - ml[i - 1] not in [-1, 1]:
				t = False
				break
		if t:
			print('YES')
			print(*ml)
		else:
			print('NO')
elif a + c != b + d:
	print('NO')
else:
	arr1 = []
	arr2 = []
	n = a + b + c + d
	(a1, b1, c1, d1) = (a, b, c, d)
	for i in range(n):
		if i % 2 == 0:
			arr1.append(0 if a > 0 else 2)
			a -= 1
			arr2.append(1 if b1 > 0 else 3)
			b1 -= 1
		else:
			arr1.append(1 if b > 0 else 3)
			b -= 1
			arr2.append(0 if a1 > 0 else 2)
			a1 -= 1
	t1 = True
	t2 = True
	for i in range(1, n):
		if abs(arr1[i] - arr1[i - 1]) != 1:
			t1 = False
		if abs(arr2[i] - arr2[i - 1]) != 1:
			t2 = False
		if not t1 and (not t2):
			break
	if t1:
		print('YES')
		print(*arr1)
	elif t2:
		print('YES')
		print(*arr2)
	else:
		print('NO')


def solve():
	s = input()
	if 'aa' in s or 'bb' in s or 'cc' in s:
		print(-1)
		return
	syms = s + '@'
	ans = ['@']
	for (i, sym) in enumerate(s):
		if sym != '?':
			ans.append(sym)
			continue
		for x in 'abc':
			if x != ans[-1] and x != syms[i + 1]:
				ans.append(x)
				break
	print(''.join(ans[1:]))

def solveb():
	n = int(input())
	perm = [int(x) for x in input().split()]
	num___idx = [-1 for _ in range(n + 1)]
	for (i, num) in enumerate(perm):
		num___idx[num] = i
	curr_max = -1
	curr_min = 2 * n
	num___pretty = [0 for _ in range(n + 1)]
	for num in range(1, n + 1):
		curr_max = max(num___idx[num], curr_max)
		curr_min = min(num___idx[num], curr_min)
		if curr_max - curr_min + 1 == num:
			num___pretty[num] = 1
	print(*num___pretty[1:], sep='')

def solvec():
	n = int(input())
	rank___problems_nr = [int(x) for x in input().split()]
	weird_prefsums = [0]
	last_num = rank___problems_nr[0]
	for num in rank___problems_nr:
		if num != last_num:
			last_num = num
			weird_prefsums.append(weird_prefsums[-1])
		weird_prefsums[-1] += 1
	gold = weird_prefsums[0]
	silvers = 0
	i = 1
	for i in range(1, len(weird_prefsums)):
		x = weird_prefsums[i]
		if x - gold > gold:
			silvers = x - gold
			break
	bronzes = 0
	for j in range(i, len(weird_prefsums)):
		x = weird_prefsums[j]
		if x > n / 2:
			break
		if x - gold - silvers > gold:
			bronzes = x - gold - silvers
	if bronzes == 0 or silvers == 0:
		print(0, 0, 0)
		return
	print(gold, silvers, bronzes)

def solved():
	(a, b, c, d) = (int(x) for x in input().split())
	ab_len = min(a, b)
	a -= ab_len
	b -= ab_len
	cd_len = min(c, d)
	c -= cd_len
	d -= cd_len
	if a == 1 and cd_len == 0 and (d == 0) and (c == 0):
		print('YES')
		print('0 1 ' * ab_len + '0')
		return
	if d == 1 and ab_len == 0 and (a == 0) and (b == 0):
		print('YES')
		print('3 ' + '2 3 ' * cd_len)
		return
	if a > 0 or d > 0:
		print('NO')
		return
	cb_len = min(b, c)
	b -= cb_len
	c -= cb_len
	if b > 1 or c > 1:
		print('NO')
		return
	print('YES')
	print('1 ' * b + '0 1 ' * ab_len + '2 1 ' * cb_len + '2 3 ' * cd_len + '2' * c)
solved()


import sys
input = sys.stdin.readline
(A, B, C, D) = map(int, input().split())
if A + C == B + D:
	if B >= A and C >= D:
		print('YES')
		ans = []
		for _ in range(D):
			ans.append(3)
			ans.append(2)
		for _ in range(C - D):
			ans.append(1)
			ans.append(2)
		for _ in range(A):
			ans.append(1)
			ans.append(0)
		print(' '.join([str(a) for a in ans]))
	else:
		print('NO')
elif A + C == B + D + 1:
	if B >= A and C >= D + 1:
		print('YES')
		ans = []
		for _ in range(A):
			ans.append(0)
			ans.append(1)
		for _ in range(B - A):
			ans.append(2)
			ans.append(1)
		for _ in range(D):
			ans.append(2)
			ans.append(3)
		ans.append(2)
		print(' '.join([str(a) for a in ans]))
	elif A == B + 1 and C == 0 and (D == 0):
		print('YES')
		ans = []
		for _ in range(B):
			ans.append(0)
			ans.append(1)
		ans.append(0)
		print(' '.join([str(a) for a in ans]))
	else:
		print('NO')
elif B + D == A + C + 1:
	if B >= A + 1 and C >= D:
		print('YES')
		ans = []
		for _ in range(D):
			ans.append(3)
			ans.append(2)
		for _ in range(C - D):
			ans.append(1)
			ans.append(2)
		for _ in range(A):
			ans.append(1)
			ans.append(0)
		ans.append(1)
		print(' '.join([str(a) for a in ans]))
	elif D == C + 1 and A == 0 and (B == 0):
		print('YES')
		ans = []
		for _ in range(C):
			ans.append(3)
			ans.append(2)
		ans.append(3)
		print(' '.join([str(a) for a in ans]))
	else:
		print('NO')
else:
	print('NO')


(a, b, c, d) = map(int, input().split())
if a > b + 1 or d > c + 1:
	print('NO')
elif a == b + 1:
	if c == d == 0:
		print('YES')
		print('0 1 ' * b + ' 0')
	else:
		print('NO')
elif d == c + 1:
	if a == b == 0:
		print('YES')
		print('3 2 ' * c + ' 3')
	else:
		print('NO')
else:
	b -= a
	c -= d
	k = min(b, c)
	if abs(b - c) >= 2:
		print('NO')
	else:
		(xb, xc) = (b - k, c - k)
		ans = '1' * xb + '01' * a + '21' * k + '23' * d + '2' * xc
		print('YES')
		print(' '.join(ans))


def make(num, a, b):
	arr = [a if i % 2 == 0 else b for i in range(2 * num)]
	return arr

def is_valid(a, n):
	for i in range(1, n):
		if abs(a[i] - a[i - 1]) != 1:
			return False
	return True

def solve(a):
	ans = []
	n = len(a)
	flg = True
	for i in range(n - 1):
		if a[i] == 0:
			continue
		if a[i + 1] < a[i] - 1:
			return (False, None)
			break
		arr = make(a[i] - 1, i, i + 1)
		arr.append(i)
		ans.extend(arr)
		a[i + 1] -= a[i] - 1
		a[i] = 0
	if a[-1] not in [0, 1]:
		return (False, None)
	elif a[-1] == 1:
		ans.append(n - 1)
	flg = is_valid(ans, len(ans))
	if flg == False:
		return (flg, None)
	return (flg, ans)
a = list(map(int, input().split()))
cur = 0
while a[0] == 0:
	a.pop(0)
	cur += 1
b = [x for x in a]
(flg, ans) = solve(a)
if flg == False:
	if len(b) > 1 and b[1] > 0:
		b[1] -= 1
		(flg, ans) = solve(b)
	if flg == False:
		print('NO')
	else:
		print('YES')
		ans = [1] + ans
		print(' '.join([str(x + cur) for x in ans]))
else:
	print('YES')
	print(' '.join([str(x + cur) for x in ans]))


import sys, os, io
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
PI = 3.141592653589793
INF = float('inf')
MOD = 1000000007

def bin32(num):
	return '{0:032b}'.format(num)

def add(x, y):
	return (x + y) % MOD

def sub(x, y):
	return (x - y + MOD) % MOD

def mul(x, y):
	return x * y % MOD

def gcd(x, y):
	if y == 0:
		return x
	return gcd(y, x % y)

def lcm(x, y):
	return x * y // gcd(x, y)

def power(x, y):
	res = 1
	x %= MOD
	while y != 0:
		if y & 1:
			res = mul(res, x)
		y >>= 1
		x = mul(x, x)
	return res

def mod_inv(n):
	return power(n, MOD - 2)

def prob(p, q):
	return mul(p, power(q, MOD - 2))

def ii():
	return int(input())

def li():
	return [int(i) for i in input().split()]

def ls():
	return [i for i in input().split()]
l = li()
n = sum(l)
l.insert(0, 0)
l.append(0)
for i in range(1, 5):
	root = i
	ans = []
	L = l[:]
	if l[root] == 0:
		continue
	while True:
		L[root] -= 1
		ans.append(root - 1)
		if L[root - 1] > 0:
			root -= 1
		elif L[root + 1] > 0:
			root += 1
		else:
			break
	if len(ans) == n:
		print('YES')
		print(*ans)
		exit(0)
print('NO')


def main():
	(A, B, C, D) = map(int, input().split())
	N = A + B + C + D
	ans = [0] * N
	(a, b, c, d) = (A - 1, B, C, D)
	prev = 0
	ok = 1
	for i in range(1, N):
		if a < 0 or b < 0 or c < 0 or (d < 0):
			ok = 0
			break
		if prev == 0:
			b -= 1
			ans[i] = 1
			prev = 1
		elif prev == 3:
			c -= 1
			ans[i] = 2
			prev = 2
		elif prev == 1:
			if a:
				a -= 1
				ans[i] = 0
				prev = 0
			else:
				c -= 1
				ans[i] = 2
				prev = 2
		elif prev == 2:
			if b:
				b -= 1
				ans[i] = 1
				prev = 1
			else:
				d -= 1
				ans[i] = 3
				prev = 3
	if a < 0 or b < 0 or c < 0 or (d < 0):
		ok = 0
	if ok:
		print('YES')
		print(*ans)
		exit()
	ans = [0] * N
	ans[0] = 1
	(a, b, c, d) = (A, B - 1, C, D)
	prev = 1
	ok = 1
	for i in range(1, N):
		if a < 0 or b < 0 or c < 0 or (d < 0):
			ok = 0
			break
		if prev == 0:
			b -= 1
			ans[i] = 1
			prev = 1
		elif prev == 3:
			c -= 1
			ans[i] = 2
			prev = 2
		elif prev == 1:
			if a:
				a -= 1
				ans[i] = 0
				prev = 0
			else:
				c -= 1
				ans[i] = 2
				prev = 2
		elif prev == 2:
			if b:
				b -= 1
				ans[i] = 1
				prev = 1
			else:
				d -= 1
				ans[i] = 3
				prev = 3
	if a < 0 or b < 0 or c < 0 or (d < 0):
		ok = 0
	if ok:
		print('YES')
		print(*ans)
		exit()
	ans = [0] * N
	ans[0] = 2
	(a, b, c, d) = (A, B, C - 1, D)
	prev = 2
	ok = 1
	for i in range(1, N):
		if a < 0 or b < 0 or c < 0 or (d < 0):
			ok = 0
			break
		if prev == 0:
			b -= 1
			ans[i] = 1
			prev = 1
		elif prev == 3:
			c -= 1
			ans[i] = 2
			prev = 2
		elif prev == 1:
			if c:
				c -= 1
				ans[i] = 2
				prev = 2
			else:
				a -= 1
				ans[i] = 0
				prev = 0
		elif prev == 2:
			if d:
				d -= 1
				ans[i] = 3
				prev = 3
			else:
				b -= 1
				ans[i] = 1
				prev = 1
	if a < 0 or b < 0 or c < 0 or (d < 0):
		ok = 0
	if ok:
		print('YES')
		print(*ans)
		exit()
	ans = [0] * N
	ans[0] = 3
	(a, b, c, d) = (A, B, C, D - 1)
	prev = 3
	ok = 1
	for i in range(1, N):
		if a < 0 or b < 0 or c < 0 or (d < 0):
			ok = 0
			break
		if prev == 0:
			b -= 1
			ans[i] = 1
			prev = 1
		elif prev == 3:
			c -= 1
			ans[i] = 2
			prev = 2
		elif prev == 1:
			if c:
				c -= 1
				ans[i] = 2
				prev = 2
			else:
				a -= 1
				ans[i] = 0
				prev = 0
		elif prev == 2:
			if d:
				d -= 1
				ans[i] = 3
				prev = 3
			else:
				b -= 1
				ans[i] = 1
				prev = 1
	if a < 0 or b < 0 or c < 0 or (d < 0):
		ok = 0
	if ok:
		print('YES')
		print(*ans)
	else:
		print('NO')
main()


(a, b, c, d) = map(int, input().split())
n = a + b + c + d
if n == 1 and a == 1:
	print('YES')
	print(0)
elif n == 2 and b == 2:
	print('NO')
elif a == 0 and b == 0:
	if c == 0:
		if d == 1:
			print('YES')
			print(3)
		else:
			print('NO')
	elif d == c - 1 or d == c or d == c + 1:
		print('YES')
		if d == c + 1:
			print(3, end=' ')
			n = n - 1
		for i in range(n):
			if i % 2 == 0:
				print(2, end=' ')
			else:
				print(3, end=' ')
	else:
		print('NO')
elif d > c:
	print('NO')
elif d == 0 and c == 0:
	if b < a - 1 or b > a + 1:
		print('NO')
	else:
		print('YES')
		if b == a + 1:
			print(1, end=' ')
			n = n - 1
		for i in range(n):
			if i % 2 == 0:
				print(0, end=' ')
			else:
				print(1, end=' ')
else:
	nee = a + max(0, c - d - 1)
	if b < nee or b > nee + 2:
		print('NO')
	elif b < a:
		print('NO')
	else:
		print('YES')
		if nee + 2 == b or b == nee + 1:
			print(1, end=' ')
			b = b - 1
			for i in range(n - 1):
				if i % 2 == 0 and a != 0:
					print(0, end=' ')
					a -= 1
				elif i % 2 == 0 and c != 0:
					print(2, end=' ')
					c -= 1
				elif b != 0:
					print(1, end=' ')
					b -= 1
				else:
					print(3, end=' ')
		else:
			for i in range(n):
				if i % 2 == 0 and a != 0:
					print(0, end=' ')
					a -= 1
				elif i % 2 == 0 and c != 0:
					print(2, end=' ')
					c -= 1
				elif b != 0:
					print(1, end=' ')
					b -= 1
				else:
					print(3, end=' ')


g = list(map(int, input().split()))
v = [-1, 1, 0, 0, 1, -1]
g.insert(0, 0)
g.append(0)
for i in range(1, 5, 1):
	if g[i] == 0:
		continue
	s = [i]
	c = g.copy()
	c[i] -= 1
	while c[1] + c[2] + c[3] + c[4] > 0:
		a = s[-1] - 1
		b = s[-1] + 1
		if v[b] > v[a]:
			(a, b) = (b, a)
		if c[a] == 0:
			a = b
		if c[a] == 0:
			break
		c[a] -= 1
		s.append(a)
	if c[1] + c[2] + c[3] + c[4] > 0:
		continue
	flag = True
	for i in range(g[1] + g[2] + g[3] + g[4] - 1):
		if abs(s[i + 1] - s[i]) != 1:
			flag = False
			break
	if flag:

		def f(a):
			return str(a - 1)
		print('YES')
		print(' '.join(list(map(f, s))))
		exit()
print('NO')


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
from collections import Counter
import bisect
import math

def nCk(n, k):
	res = 1
	for i in range(1, k + 1):
		res = res * (n - i + 1) // i
	return res
from collections import deque
import heapq
from collections import Counter
(a, b, c, d) = map(int, input().split())
s = ''
s += '01' * a
f = 0
if a > b:
	if a == b + 1 and c == d == 0:
		s = s[:2 * a - 2]
		s = s + '0'
		print('YES')
		s = list(s)
		print(*s)
	else:
		print('NO')
		exit()
else:
	ss = '23' * d
	if c < d:
		if c + 1 == d and a == 0 and (b == 0):
			ss = ss[:2 * d - 2]
			ss = '3' + ss
			print('YES')
			ss = list(ss)
			print(*ss)
			exit()
		else:
			print('NO')
			exit()
	else:
		var = b - a
		var2 = c - d
		if var != var2:
			v = min(var, var2)
			ss = s + '21' * v + ss
			var -= v
			var2 -= v
			if var == 1:
				ss = '1' + ss
			elif var2 == 1:
				ss += '2'
			else:
				print('NO')
				exit()
			print('YES')
			ss = list(ss)
			print(*ss)
			exit()
		else:
			print('YES')
			ss = s + '21' * var + ss
			ss = list(ss)
			print(*ss)


def printres(res):
	print('YES')
	print(' '.join(map(str, res)))

def main():
	cc = [int(a) for a in input().split()]
	nz = []
	for (i, c) in enumerate(cc):
		if c > 0:
			nz.append(i)
	if len(nz) == 1:
		if cc[nz[0]] == 1:
			printres([nz[0]])
		else:
			print('NO')
		return
	elif len(nz) == 2:
		if nz[1] != nz[0] + 1:
			print('NO')
			return
		df = cc[nz[1]] - cc[nz[0]]
		if abs(df) > 1:
			print('NO')
			return
		if df == 1:
			printres([nz[1]] + [nz[0], nz[1]] * cc[nz[0]])
		elif df == 0:
			printres([nz[0], nz[1]] * cc[nz[0]])
		else:
			printres([nz[0], nz[1]] * cc[nz[1]] + [nz[0]])
		return
	elif len(nz) == 3:
		if nz[2] != nz[1] + 1 or nz[1] != nz[0] + 1:
			print('NO')
			return
		df = cc[nz[0]] + cc[nz[2]] - cc[nz[1]]
		if abs(df) > 1:
			print('NO')
			return
		if df == 1:
			printres([nz[0], nz[1]] * cc[nz[0]] + [nz[2], nz[1]] * (cc[nz[2]] - 1) + [nz[2]])
		elif df == 0:
			printres([nz[0], nz[1]] * cc[nz[0]] + [nz[2], nz[1]] * cc[nz[2]])
		else:
			printres([nz[1]] + [nz[0], nz[1]] * cc[nz[0]] + [nz[2], nz[1]] * cc[nz[2]])
		return
	else:
		df = cc[0] - cc[1] + cc[2] - cc[3]
		if abs(df) > 1:
			print('NO')
			return
		y = min(cc[1] - cc[0], cc[2] - cc[3])
		if y < 0:
			print('NO')
			return
		base = [0, 1] * cc[0] + [2, 1] * y + [2, 3] * cc[3]
		if df == 1:
			printres(base + [2])
		elif df == 0:
			printres(base)
		else:
			printres([1] + base)
		return
main()


import os
import sys
from math import *
from collections import *
from bisect import *
from io import BytesIO, IOBase

def vsInput():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
ALPHA = 'abcdefghijklmnopqrstuvwxyz'
M = 10 ** 9 + 7
EPS = 1e-06

def Ceil(a, b):
	return a // b + int(a % b > 0)

def value():
	return tuple(map(int, input().split()))

def array():
	return [int(i) for i in input().split()]

def Int():
	return int(input())

def Str():
	return input()

def arrayS():
	return [i for i in input().split()]
(c0, c1, c2, c3) = value()
ok = True
tot = c0 + c1 + c2 + c3
M = c0 + c2 + c0 + c2 + 1
ans = [-1] * (c0 + c2 + c0 + c2 + 1)
M = len(ans)
if tot > M or tot < c0 + c2 + c0 + c2 - 1:
	ok = False
for i in range(len(ans)):
	if i % 2:
		if c0:
			c0 -= 1
			ans[i] = 0
		elif c2:
			c2 -= 1
			ans[i] = 2
for i in range(len(ans) - 2, 0, -1):
	if c3 and ans[i - 1] == 2 and (ans[i + 1] == 2):
		c3 -= 1
		ans[i] = 3
if c3 and (len(ans) == 1 or ans[-2] == 2):
	ans[-1] = 3
	c3 -= 1
if c3 and (len(ans) == 1 or ans[1] == 2):
	ans[0] = 3
	c3 -= 1
if c3:
	ok = False
for i in range(2, len(ans)):
	if ans[i] == -1 and c1:
		c1 -= 1
		ans[i] = 1
if c1 and ans[0] == -1:
	ans[0] = 1
	c1 -= 1
if c1:
	ok = False
start = 0
end = len(ans) - 1
while start < len(ans) and ans[start] == -1:
	start += 1
while end >= 0 and ans[end] == -1:
	end -= 1
for i in range(start, end + 1):
	if ans[i] == -1:
		ok = False
if ok:
	print('YES')
	print(*ans[start:end + 1])
else:
	print('NO')


(a, b, c, d) = map(int, input().split())
length = min(a, b)
(a, b) = (a - length, b - length)
answer = [0, 1] * length
length = min(c, d)
(c, d) = (c - length, d - length)
answer.extend([2, 3] * length)
length = min(b, c)
(b, c) = (b - length, c - length)
answer.extend([2, 1] * length)
if a > 0:
	answer.append(0)
	a -= 1
if b > 0:
	answer.insert(0, 1)
	b -= 1
if c > 0:
	answer.append(2)
	c -= 1
if d > 0:
	answer.insert(0, 3)
	d -= 1
is_right = True
for i in range(0, len(answer) - 1):
	if abs(answer[i] - answer[i + 1]) != 1:
		is_right = False
		break
if not is_right or a + b + c + d:
	print('NO')
else:
	print('YES')
	print(*answer)


_count = list(map(int, input().split()))
num = '0 1 2 3'.split()
for pos in range(4):
	count = _count[:]
	ans = []
	for i in range(sum(count)):
		ans.append(num[pos])
		count[pos] -= 1
		if pos == 1:
			if count[0] > 0:
				pos = 0
			else:
				pos = 2
		elif pos == 2:
			if count[3] > 0:
				pos = 3
			else:
				pos = 1
		elif pos == 0:
			pos = 1
		elif pos == 3:
			pos = 2
	if max(count) == min(count) == 0:
		print('YES')
		print(*ans)
		exit()
else:
	print('NO')


(a, b, c, d) = map(int, input().split())
p = 0
e = []
if a > b:
	if c == 0 and d == 0 and (a == b + 1):
		for j in range(a + b):
			if j % 2 == 0:
				e.append(0)
			else:
				e.append(1)
	else:
		p = 1
elif d > c:
	if a == 0 and b == 0 and (d == c + 1):
		for j in range(c + d):
			if j % 2 == 0:
				e.append(3)
			else:
				e.append(2)
	else:
		p = 1
else:
	g = []
	f = []
	i = []
	for j in range(2 * a):
		if j % 2 == 0:
			g.append(0)
		else:
			g.append(1)
	for j in range(2 * d):
		if j % 2 == 0:
			f.append(2)
		else:
			f.append(3)
	b += -a
	c += -d
	if abs(b - c) > 1:
		p = 1
	else:
		if abs(b - c) == 0:
			for j in range(b + c):
				if j % 2 == 0:
					i.append(2)
				else:
					i.append(1)
		if b == c + 1:
			for j in range(2 * c):
				if j % 2 == 0:
					i.append(2)
				else:
					i.append(1)
			g.insert(0, 1)
		elif c == b + 1:
			for j in range(2 * b):
				if j % 2 == 0:
					i.append(2)
				else:
					i.append(1)
			f.append(2)
	e = g + i + f
if p == 1:
	print('NO')
else:
	print('YES')
	print(*e)


a = list(map(int, input().split(' ')))
for i in range(4):
	res = []
	b = []
	if a[i] != 0:
		for j in range(4):
			b.append(a[j])
		j = i
		b[j] -= 1
		res.append(j)
		while 1:
			chk = 1
			if j == 0:
				if b[j + 1] > 0:
					b[j + 1] -= 1
					res.append(j + 1)
					j += 1
					chk = 0
			elif j == 1:
				if b[j - 1] > 0:
					b[j - 1] -= 1
					res.append(j - 1)
					j -= 1
					chk = 0
				elif b[j + 1] > 0:
					b[j + 1] -= 1
					res.append(j + 1)
					j += 1
					chk = 0
			elif j == 2:
				if b[j + 1] > 0:
					b[j + 1] -= 1
					res.append(j + 1)
					j += 1
					chk = 0
				elif b[j - 1] > 0:
					b[j - 1] -= 1
					res.append(j - 1)
					j -= 1
					chk = 0
			elif j == 3:
				if b[j - 1] > 0:
					b[j - 1] -= 1
					res.append(j - 1)
					j -= 1
					chk = 0
			if chk:
				break
		f = 1
		for i in range(4):
			if b[i] != 0:
				f = 0
		if f:
			print('YES')
			print(*res)
			exit()
print('NO')


import sys
(a, b, c, d) = map(int, input().split())
(a0, b0, c0, d0) = (a, b, c, d)
(ab, bc, cd) = ([], [], [])
while a and b:
	a -= 1
	b -= 1
	ab.extend([0, 1])
if a:
	if not c0 and (not d0) and (a == 1):
		ab.append(0)
		print('YES')
		print(*ab)
	else:
		print('NO')
	sys.exit()
while c and d:
	c -= 1
	d -= 1
	cd.extend([2, 3])
if d:
	if not a0 and (not b0) and (d == 1):
		cd.insert(0, 3)
		print('YES')
		print(*cd)
	else:
		print('NO')
	sys.exit()
while b and c:
	b -= 1
	c -= 1
	bc.extend([2, 1])
if b > 1 or c > 1:
	print('NO')
	sys.exit()
if b == 1:
	ab.insert(0, 1)
if c == 1:
	cd.append(2)
ans = ab + bc + cd
print('YES')
print(*ans)


numbers = list(map(int, input().split(' ')))

def solve(numbers, x):
	n = sum(numbers)
	a = [None for i in range(n)]
	for i in range(n):
		if not numbers[x]:
			return
		a[i] = x
		numbers[x] -= 1
		if not sum(numbers):
			break
		if x and numbers[x - 1]:
			x -= 1
		elif x < 3 and numbers[x + 1]:
			x += 1
		else:
			return None
	return a
for i in range(4):
	sol = solve(list(numbers), i)
	if sol:
		print('YES')
		print(' '.join(map(str, sol)))
		exit(0)
print('NO')


(a, b, c, d) = map(int, input().split())
if abs(a + c - b - d) <= 1 and b >= a and (c >= d):
	print('YES')
	if a + c > b + d:
		for i in range(a):
			print(0, 1, end=' ')
		for i in range(b - a):
			print(2, 1, end=' ')
		for i in range(d):
			print(2, 3, end=' ')
		print(2)
	elif a + c == b + d:
		for i in range(a):
			print(0, 1, end=' ')
		for i in range(b - a):
			print(2, 1, end=' ')
		for i in range(d):
			print(2, 3, end=' ')
	elif a + c < b + d:
		for i in range(d):
			print(3, 2, end=' ')
		for i in range(c - d):
			print(1, 2, end=' ')
		for i in range(a):
			print(1, 0, end=' ')
		print(1)
elif a == 0 and b == 0 and (d - c == 1):
	print('YES')
	for i in range(c):
		print(3, 2, end=' ')
	print(3)
elif d == 0 and c == 0 and (a - b == 1):
	print('YES')
	for i in range(b):
		print(0, 1, end=' ')
	print(0)
else:
	print('NO')


from copy import copy

def arr_float_inp():
	return [float(s) for s in input().split()]

def arr_int_inp():
	return [int(s) for s in input().split()]

def int_inp():
	return int(input())

def float_inp():
	return float(input())
arr = arr_int_inp()
required_length = sum(arr)
out = []
solution_founded = False
for i in range(4):
	if arr[i] == 0:
		continue
	new_arr = copy(arr)
	prev = i
	new_arr[i] -= 1
	out.append(i)
	while True:
		if prev == 0:
			if new_arr[1] != 0:
				new_arr[1] -= 1
				prev = 1
				out.append(1)
			else:
				break
		elif prev == 1:
			if new_arr[0] != 0:
				new_arr[0] -= 1
				prev = 0
				out.append(0)
			elif new_arr[2] != 0:
				new_arr[2] -= 1
				prev = 2
				out.append(2)
			else:
				break
		elif prev == 2:
			if new_arr[1] != 0:
				new_arr[1] -= 1
				prev = 1
				out.append(1)
			elif new_arr[3] != 0:
				new_arr[3] -= 1
				prev = 3
				out.append(3)
			else:
				break
		elif prev == 3:
			if new_arr[2] != 0:
				new_arr[2] -= 1
				prev = 2
				out.append(2)
			else:
				break
	if len(out) == required_length:
		solution_founded = True
		break
	else:
		out.clear()
if solution_founded:
	print('YES')
	for el in out:
		print(el, end=' ')
else:
	print('NO')


(a, b, c, d) = map(int, input().split())
if a == b and b == 0:
	if abs(c - d) > 1:
		print('NO')
	else:
		print('YES')
		if c > d:
			for i in range(d):
				print('2 3', end=' ')
			print('2')
		elif d > c:
			for i in range(c):
				print('3 2', end=' ')
			print('3')
		else:
			for i in range(c):
				print('3 2', end=' ')
			print()
elif b == c and c == d and (d == 0):
	if a == 1:
		print('YES')
		print(0)
	else:
		print('NO')
elif a == c and c == d and (d == 0):
	if b == 1:
		print('YES')
		print(1)
	else:
		print('NO')
elif a == b and b == d and (d == 0):
	if c == 1:
		print('YES')
		print(2)
	else:
		print('NO')
elif a == b and b == c and (c == 0):
	if d == 1:
		print('YES')
		print(3)
	else:
		print('NO')
else:
	ans = ''
	flag = True
	flag_1 = False
	if b >= a:
		if b > a:
			ans += '1 '
			flag = False
			flag_1 = True
		for i in range(a):
			ans += '0 1 '
			flag = False
		b -= a + 1
		if b <= 0:
			if d == c - 1 or d == c:
				for i in range(d):
					ans += '2 3 '
				if d == c - 1:
					ans += '2'
				print('YES')
				print(ans)
			elif d + 2 == c and flag_1:
				for i in range(d):
					ans += '2 3 '
				print('YES')
				print('2 ' + ans + '2')
			elif flag:
				if d == c + 1:
					for i in range(c):
						ans += '3 2 '
					ans += '3'
					print('YES')
					print(ans)
			else:
				print('NO')
		elif c >= b:
			for i in range(b):
				ans += '2 1 '
			c -= b
			if c >= 1:
				ans += '2 '
				c -= 1
			if d >= c:
				if d == c or d == c + 1:
					print('YES')
					for i in range(c):
						ans += '3 2 '
					if d == c + 1:
						ans += '3'
					print(ans)
				else:
					print('NO')
			elif d == 0 and c == 1:
				print('YES')
				print('2 ' + ans)
			elif d + 1 == c:
				print('YES')
				for i in range(d):
					ans += '3 2 '
				print('2 ' + ans)
			else:
				print('NO')
		else:
			print('NO')
	elif c == d and d == 0:
		if a == b + 1:
			print('YES')
			print('0', end=' ')
			for i in range(b):
				print('1 0', end=' ')
			print()
		else:
			print('NO')
	else:
		print('NO')


(n0, n1, n2, n3) = map(int, input().split())
if n2 + n3 == 0:
	if n0 == n1:
		print('YES')
		for i in range(n0):
			print(0, 1, end=' ')
	elif abs(n0 - n1) == 1:
		print('YES')
		if n0 < n1:
			print(1, end=' ')
			for i in range(n0):
				print(0, 1, end=' ')
		else:
			print(0, end=' ')
			for i in range(n1):
				print(1, 0, end=' ')
	else:
		print('NO')
elif n0 + n1 == 0:
	if n2 == n3:
		print('YES')
		for i in range(n2):
			print(2, 3, end=' ')
	elif abs(n2 - n3) == 1:
		print('YES')
		if n2 < n3:
			print(3, end=' ')
			for i in range(n2):
				print(2, 3, end=' ')
		else:
			print(2, end=' ')
			for i in range(n3):
				print(3, 2, end=' ')
	else:
		print('NO')
elif n0 + n3 == 0:
	if n1 == n2:
		print('YES')
		for i in range(n1):
			print(2, 1, end=' ')
	elif abs(n2 - n1) == 1:
		print('YES')
		if n2 < n1:
			print(1, end=' ')
			for i in range(n2):
				print(2, 1, end=' ')
		else:
			print(2, end=' ')
			for i in range(n1):
				print(1, 2, end=' ')
	else:
		print('NO')
elif n0 <= n1 and n3 <= n2 and (n1 - n0 == n2 - n3):
	print('YES')
	for j in range(n0):
		print(0, 1, end=' ')
	for k in range(n1 - n0):
		print(2, 1, end=' ')
	for l in range(n3):
		print(2, 3, end=' ')
elif n0 <= n1 and n3 <= n2 and (n1 - n0 == n2 - n3 + 1):
	print('YES')
	print(1, end=' ')
	for j in range(n0):
		print(0, 1, end=' ')
	for k in range(n2 - n3):
		print(2, 1, end=' ')
	for l in range(n3):
		print(2, 3, end=' ')
elif n0 <= n1 and n3 <= n2 and (n1 - n0 + 1 == n2 - n3):
	print('YES')
	for j in range(n0):
		print(0, 1, end=' ')
	for k in range(n1 - n0):
		print(2, 1, end=' ')
	for l in range(n3):
		print(2, 3, end=' ')
	print(2)
else:
	print('NO')


def find_ans(a, b, c, d):
	if a == 0 and b == 0:
		if d == c + 1:
			str_ = '2 3 ' * c
			str_ = '3 ' + str_
			print('YES')
			print(str_)
			return
	elif d == 0 and c == 0:
		if a - 1 == b:
			str_ = '0 1 ' * b
			str_ = str_ + '0'
			print('YES')
			print(str_)
			return
	if a > b or d > c:
		print('NO')
		return
	str_left = '0 1 ' * a
	b = b - a
	str_right = '2 3 ' * d
	c = c - d
	str_val = '2 1 ' * min(b, c)
	(b, c) = (b - min(b, c), c - min(b, c))
	if b > 1 or c > 1:
		print('NO')
		return
	if b == 1:
		str_left = '1 ' + str_left
	if c == 1:
		str_right += '2 '
	result = str_left + str_val + str_right
	print('YES')
	print(result)

def main():
	values = input()
	values = values.split(' ')
	find_ans(int(values[0]), int(values[1]), int(values[2]), int(values[3]))
main()


(a, b, c, d) = map(int, input().split())
ans = []
for i in range(a):
	ans.append(0)
	if b:
		ans.append(1)
		b -= 1
if len(ans) and b and (ans[-1] == 0):
	ans.append(1)
	b -= 1
tan = []
for i in range(d):
	tan.append(3)
	if c:
		tan.append(2)
		c -= 1
flag = 0
if len(tan) and c and (tan[-1] == 3):
	tan.append(2)
	c -= 1
for i in range(1, len(ans)):
	if ans[i] == ans[i - 1]:
		print('NO')
		exit()
for i in range(1, len(tan)):
	if tan[i] == tan[i - 1]:
		print('NO')
		exit()
if len(ans) == 0 and len(tan) == 0:
	if abs(b - c) <= 1:
		print('YES')
		if b > c:
			i = 0
			while 1:
				if i % 2 == 0:
					if b:
						print('1', end=' ')
						i += 1
						b -= 1
					else:
						break
				elif c:
					print('2', end=' ')
					i += 1
					c -= 1
				else:
					break
			exit()
		else:
			i = 0
			while 1:
				if i % 2 == 0:
					if c:
						print('2', end=' ')
						i += 1
						c -= 1
					else:
						break
				elif b:
					print('1', end=' ')
					b -= 1
					i += 1
				else:
					break
			exit()
	else:
		print('NO')
		exit()
if len(tan) == 0:
	i = 0
	while 1:
		if i % 2 == 0:
			if c and ans[-1] == 1:
				c -= 1
				ans.append(2)
				i += 1
			else:
				break
		elif b and (ans[-1] == 0 or ans[-1] == 2):
			ans.append(1)
			i += 1
			b -= 1
		else:
			break
	if b == 0 and c == 0:
		print('YES')
		print(*ans)
		exit()
	if b == 1 and c == 0:
		print('YES')
		print(1, end=' ')
		print(*ans)
		exit()
	print('NO')
	exit()
if len(ans) == 0:
	i = 0
	while 1:
		if i % 2 == 0:
			if b and tan[-1] == 2:
				b -= 1
				tan.append(1)
				i += 1
			else:
				break
		elif c and (tan[-1] == 1 or tan[-1] == 3):
			tan.append(2)
			i += 1
			c -= 1
		else:
			break
	if b == 0 and c == 0:
		print('YES')
		print(*tan)
		exit()
	if b == 0 and c == 1:
		print('YES')
		print(2, end=' ')
		print(*tan)
		exit()
	print('NO')
	exit()
for i in range(1, len(ans)):
	if ans[i] == ans[i - 1]:
		flag = 1
		break
for i in range(1, len(tan)):
	if tan[i] == tan[i - 1]:
		flag = 1
		break
if flag == 1:
	print('NO')
	exit()
(p, q) = (b, c)
one = ans.copy()
two = ans.copy()
i = 0
if ans[-1] == 0 or tan[-1] == 3:
	print('NO')
	exit()
while 1:
	if i % 2 == 0:
		if c:
			c -= 1
			one.append(2)
			i += 1
		else:
			break
	elif b:
		b -= 1
		one.append(1)
		i += 1
	else:
		break
if b == 1:
	one = [1] + one
	b -= 1
if one[-1] == 2:
	one.extend(tan)
	if b == 0 and c == 0:
		print('YES')
		print(*one)
		exit()
if one[-1] == 1:
	if tan[-1] == 2:
		if b == 0 and c == 0:
			print('YES')
			tan.reverse()
			one.extend(tan)
			print(*one)
			exit()
(b, c) = (p, q)
i = 0
while 1:
	if i % 2 == 0:
		if b:
			b -= 1
			two.append(1)
			i += 1
		else:
			break
	elif c:
		c -= 1
		two.append(2)
		i += 1
	else:
		break
if c == 1:
	two = [2] + one
	c -= 1
if two[-1] == 1 and b == 0 and (c == 0):
	two.extend(tan)
	print('YES')
	print(*one)
	exit()
if two[-1] == 2 and b == 0 and (c == 0):
	if tan[-1] == 1:
		print('YES')
		tan.reverse()
		one.extend(tan)
		print(*one)
		exit()
print('NO')
exit()


(a, b, c, d) = list(map(int, input().split()))
b -= a
c -= d
arr = []
k = True
if b >= 0 and c >= 0:
	if a == 0 and b == 0 and (c == 1):
		print('YES')
		arr.append(2)
		for i in range(d):
			arr.append(3)
			arr.append(2)
		print(*arr, sep=' ')
		k = False
	elif d == 0 and c == 0 and (b == 1):
		print('YES')
		arr.append(1)
		for i in range(a):
			arr.append(0)
			arr.append(1)
		print(*arr, sep=' ')
		k = False
	elif b == c and k:
		print('YES')
		if b == 0:
			for i in range(a):
				arr.append(0)
				arr.append(1)
			for i in range(d):
				arr.append(2)
				arr.append(3)
		else:
			for i in range(a):
				arr.append(1)
				arr.append(0)
			for i in range(b):
				arr.append(1)
				arr.append(2)
			for i in range(d):
				arr.append(3)
				arr.append(2)
		print(*arr, sep=' ')
	elif c - b == 1 and k:
		print('YES')
		if a > 0:
			for i in range(a - 1):
				arr.append(0)
				arr.append(1)
			arr.append(0)
			arr.append(1)
			arr.append(2)
		else:
			arr.append(2)
		for i in range(c - 1):
			arr.append(1)
			arr.append(2)
		for i in range(d):
			arr.append(3)
			arr.append(2)
		print(*arr, sep=' ')
	elif b - c == 1 and k:
		print('YES')
		for i in range(a):
			arr.append(1)
			arr.append(0)
		for i in range(b - 1):
			arr.append(1)
			arr.append(2)
		arr.append(1)
		if d > 0:
			arr.append(2)
			for i in range(d - 1):
				arr.append(3)
				arr.append(2)
			arr.append(3)
		print(*arr, sep=' ')
	else:
		print('NO')
elif b == -1 and d == 0 and (c == 0):
	print('YES')
	for i in range(a - 1):
		arr.append(0)
		arr.append(1)
	arr.append(0)
	print(*arr, sep=' ')
elif a == 0 and b == 0 and (c == -1):
	print('YES')
	for i in range(d - 1):
		arr.append(3)
		arr.append(2)
	arr.append(3)
	print(*arr, sep=' ')
else:
	print('NO')


import math
import heapq, bisect
import sys
from collections import deque, defaultdict
from fractions import Fraction
import sys
mod = 10 ** 9 + 7
mod1 = 998244353
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

class TreeNode:

	def __init__(self, k, v):
		self.key = k
		self.value = v
		self.left = None
		self.right = None
		self.parent = None
		self.height = 1
		self.num_left = 1
		self.num_total = 1

class AvlTree:

	def __init__(self):
		self._tree = None

	def add(self, k, v):
		if not self._tree:
			self._tree = TreeNode(k, v)
			return
		node = self._add(k, v)
		if node:
			self._rebalance(node)

	def _add(self, k, v):
		node = self._tree
		while node:
			if k < node.key:
				if node.left:
					node = node.left
				else:
					node.left = TreeNode(k, v)
					node.left.parent = node
					return node.left
			elif node.key < k:
				if node.right:
					node = node.right
				else:
					node.right = TreeNode(k, v)
					node.right.parent = node
					return node.right
			else:
				node.value = v
				return

	@staticmethod
	def get_height(x):
		return x.height if x else 0

	@staticmethod
	def get_num_total(x):
		return x.num_total if x else 0

	def _rebalance(self, node):
		n = node
		while n:
			lh = self.get_height(n.left)
			rh = self.get_height(n.right)
			n.height = max(lh, rh) + 1
			balance_factor = lh - rh
			n.num_total = 1 + self.get_num_total(n.left) + self.get_num_total(n.right)
			n.num_left = 1 + self.get_num_total(n.left)
			if balance_factor > 1:
				if self.get_height(n.left.left) < self.get_height(n.left.right):
					self._rotate_left(n.left)
				self._rotate_right(n)
			elif balance_factor < -1:
				if self.get_height(n.right.right) < self.get_height(n.right.left):
					self._rotate_right(n.right)
				self._rotate_left(n)
			else:
				n = n.parent

	def _remove_one(self, node):
		replacement = node.left or node.right
		if node.parent:
			if AvlTree._is_left(node):
				node.parent.left = replacement
			else:
				node.parent.right = replacement
			replacement.parent = node.parent
			node.parent = None
		else:
			self._tree = replacement
			replacement.parent = None
		node.left = None
		node.right = None
		node.parent = None
		self._rebalance(replacement)

	def _remove_leaf(self, node):
		if node.parent:
			if AvlTree._is_left(node):
				node.parent.left = None
			else:
				node.parent.right = None
			self._rebalance(node.parent)
		else:
			self._tree = None
		node.parent = None
		node.left = None
		node.right = None

	def remove(self, k):
		node = self._get_node(k)
		if not node:
			return
		if AvlTree._is_leaf(node):
			self._remove_leaf(node)
			return
		if node.left and node.right:
			nxt = AvlTree._get_next(node)
			node.key = nxt.key
			node.value = nxt.value
			if self._is_leaf(nxt):
				self._remove_leaf(nxt)
			else:
				self._remove_one(nxt)
			self._rebalance(node)
		else:
			self._remove_one(node)

	def get(self, k):
		node = self._get_node(k)
		return node.value if node else -1

	def _get_node(self, k):
		if not self._tree:
			return None
		node = self._tree
		while node:
			if k < node.key:
				node = node.left
			elif node.key < k:
				node = node.right
			else:
				return node
		return None

	def get_at(self, pos):
		x = pos + 1
		node = self._tree
		while node:
			if x < node.num_left:
				node = node.left
			elif node.num_left < x:
				x -= node.num_left
				node = node.right
			else:
				return (node.key, node.value)
		raise IndexError('Out of ranges')

	@staticmethod
	def _is_left(node):
		return node.parent.left and node.parent.left == node

	@staticmethod
	def _is_leaf(node):
		return node.left is None and node.right is None

	def _rotate_right(self, node):
		if not node.parent:
			self._tree = node.left
			node.left.parent = None
		elif AvlTree._is_left(node):
			node.parent.left = node.left
			node.left.parent = node.parent
		else:
			node.parent.right = node.left
			node.left.parent = node.parent
		bk = node.left.right
		node.left.right = node
		node.parent = node.left
		node.left = bk
		if bk:
			bk.parent = node
		node.height = max(self.get_height(node.left), self.get_height(node.right)) + 1
		node.num_total = 1 + self.get_num_total(node.left) + self.get_num_total(node.right)
		node.num_left = 1 + self.get_num_total(node.left)

	def _rotate_left(self, node):
		if not node.parent:
			self._tree = node.right
			node.right.parent = None
		elif AvlTree._is_left(node):
			node.parent.left = node.right
			node.right.parent = node.parent
		else:
			node.parent.right = node.right
			node.right.parent = node.parent
		bk = node.right.left
		node.right.left = node
		node.parent = node.right
		node.right = bk
		if bk:
			bk.parent = node
		node.height = max(self.get_height(node.left), self.get_height(node.right)) + 1
		node.num_total = 1 + self.get_num_total(node.left) + self.get_num_total(node.right)
		node.num_left = 1 + self.get_num_total(node.left)

	@staticmethod
	def _get_next(node):
		if not node.right:
			return node.parent
		n = node.right
		while n.left:
			n = n.left
		return n

class SegmentTree1:

	def __init__(self, data, default='z', func=lambda a, b: min(a, b)):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)

class SegmentTree:

	def __init__(self, data, default=0, func=lambda a, b: a + b):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)

class Factorial:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorials = [1, 1]
		self.invModulos = [0, 1]
		self.invFactorial_ = [1, 1]

	def calc(self, n):
		if n <= -1:
			print('Invalid argument to calculate n!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.factorials):
			return self.factorials[n]
		nextArr = [0] * (n + 1 - len(self.factorials))
		initialI = len(self.factorials)
		prev = self.factorials[-1]
		m = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * i % m
		self.factorials += nextArr
		return self.factorials[n]

	def inv(self, n):
		if n <= -1:
			print('Invalid argument to calculate n^(-1)')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		p = self.MOD
		pi = n % p
		if pi < len(self.invModulos):
			return self.invModulos[pi]
		nextArr = [0] * (n + 1 - len(self.invModulos))
		initialI = len(self.invModulos)
		for i in range(initialI, min(p, n + 1)):
			next = -self.invModulos[p % i] * (p // i) % p
			self.invModulos.append(next)
		return self.invModulos[pi]

	def invFactorial(self, n):
		if n <= -1:
			print('Invalid argument to calculate (n^(-1))!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.invFactorial_):
			return self.invFactorial_[n]
		self.inv(n)
		nextArr = [0] * (n + 1 - len(self.invFactorial_))
		initialI = len(self.invFactorial_)
		prev = self.invFactorial_[-1]
		p = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * self.invModulos[i % p] % p
		self.invFactorial_ += nextArr
		return self.invFactorial_[n]

class Combination:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorial = Factorial(MOD)

	def ncr(self, n, k):
		if k < 0 or n < k:
			return 0
		k = min(k, n - k)
		f = self.factorial
		return f.calc(n) * f.invFactorial(max(n - k, k)) * f.invFactorial(min(k, n - k)) % self.MOD

def powm(a, n, m):
	if a == 1 or n == 0:
		return 1
	if n % 2 == 0:
		s = powm(a, n // 2, m)
		return s * s % m
	else:
		return a * powm(a, n - 1, m) % m

def sort_list(list1, list2):
	zipped_pairs = zip(list2, list1)
	z = [x for (_, x) in sorted(zipped_pairs)]
	return z

def product(l):
	por = 1
	for i in range(len(l)):
		por *= l[i]
	return por

def binarySearchCount(arr, n, key):
	left = 0
	right = n - 1
	count = 0
	while left <= right:
		mid = int((right + left) / 2)
		if arr[mid] < key:
			count = mid + 1
			left = mid + 1
		else:
			right = mid - 1
	return count

def countdig(n):
	c = 0
	while n > 0:
		n //= 10
		c += 1
	return c

def binary(x, length):
	y = bin(x)[2:]
	return y if len(y) >= length else '0' * (length - len(y)) + y

def countGreater(arr, n, k):
	l = 0
	r = n - 1
	leftGreater = n
	while l <= r:
		m = int(l + (r - l) / 2)
		if arr[m] >= k:
			leftGreater = m
			r = m - 1
		else:
			l = m + 1
	return n - leftGreater
(a, b, c, d) = map(int, input().split())

def calc(a, b, c, d, l):
	n = a + b + c + d
	for i in range(n):
		f = 0
		if l[-1] == 0:
			if b > 0:
				f = 1
				l.append(1)
				b -= 1
		elif l[-1] == 1:
			if a > 0:
				f = 1
				l.append(0)
				a -= 1
			elif c > 0:
				f = 1
				l.append(2)
				c -= 1
		elif l[-1] == 2:
			if b > 0:
				f = 1
				l.append(1)
				b -= 1
			elif d > 0:
				f = 1
				l.append(3)
				d -= 1
		elif c > 0:
			f = 1
			l.append(2)
			c -= 1
		if f == 0:
			return False
	if len(l) != n + 1:
		return False
	return True
l = [0]
l1 = [1]
l2 = [2]
l3 = [3]
if a > 0 and calc(a - 1, b, c, d, l) == True:
	print('YES')
	print(*l)
elif b > 0 and calc(a, b - 1, c, d, l1) == True:
	print('YES')
	print(*l1)
elif c > 0 and calc(a, b, c - 1, d, l2) == True:
	print('YES')
	print(*l2)
elif d > 0 and calc(a, b, c, d - 1, l3) == True:
	print('YES')
	print(*l3)
else:
	print('NO')


import collections
import time
import os
import sys
import bisect
import heapq
from typing import List
import itertools

def place(a, b, c, d, av, bv, cv, dv):
	n = a + b + c + d
	s = [0 for _ in range(n)]
	(i, w) = (0, 0)
	while w < a and i < n:
		s[i] = av
		i += 2
		w += 1
	(j, w) = (1, 0)
	while w < b and j < n:
		s[j] = bv
		j += 2
		w += 1
	w = 0
	while w < c and i < n:
		s[i] = cv
		i += 2
	w = 0
	while w < d and j < n:
		s[j] = dv
		j += 2
	if s.count(av) == a and s.count(bv) == b and (s.count(cv) == c) and (s.count(dv) == d) and all([abs(s[i] - s[i + 1]) == 1 for i in range(n - 1)]):
		return s
	return []

def solve(a, b, c, d):
	for s in itertools.permutations([(a, 0), (b, 1), (c, 2), (d, 3)]):
		t = place(s[0][0], s[1][0], s[2][0], s[3][0], s[0][1], s[1][1], s[2][1], s[3][1])
		if t:
			print('YES')
			print(' '.join(map(str, t)))
			return
	print('NO')
(a, b, c, d) = map(int, input().split())
solve(a, b, c, d)


from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase
from itertools import *
import bisect
from heapq import *
from math import *
from copy import *
from collections import deque
from collections import Counter as counter
from itertools import combinations as comb
from itertools import permutations as permutate
from bisect import bisect_left as bl
from bisect import bisect_right as br
from bisect import bisect
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
from types import GeneratorType

def iterative(f, stack=[]):

	def wrapped_func(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		to = f(*args, **kwargs)
		while True:
			if type(to) is GeneratorType:
				stack.append(to)
				to = next(to)
				continue
			stack.pop()
			if not stack:
				break
			to = stack[-1].send(to)
		return to
	return wrapped_func
mod = 1000000007

def inp():
	return sys.stdin.readline().rstrip('\r\n')

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def zerolist(n):
	return [0] * n

def nextline():
	out('\n')

def testcase(t):
	for pp in range(t):
		solve(pp)

def printlist(a):
	for p in range(0, len(a)):
		out(str(a[p]) + ' ')

def google(p):
	print('Case #' + str(p) + ': ', end='')

def lcm(a, b):
	return a * b // gcd(a, b)

def power(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def ncr(n, r):
	return factorial(n) // (factorial(r) * factorial(max(n - r, 1)))

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def solve(case):
	(a, b, c, d) = sep()
	left = []
	right = []
	mid = []
	for i in range(min(a, b)):
		left.append(0)
		left.append(1)
		a -= 1
		b -= 1
	for i in range(min(c, d)):
		right.append(2)
		right.append(3)
		c -= 1
		d -= 1
	for i in range(min(c, b)):
		mid.append(2)
		mid.append(1)
		c -= 1
		b -= 1
	if b > 0:
		left.insert(0, 1)
		b -= 1
	if c > 0:
		right.append(2)
		c -= 1
	if a > 0:
		left.append(0)
		a -= 1
	if d > 0:
		right.insert(0, 3)
		d -= 1
	if a > 0 or b > 0 or c > 0 or (d > 0):
		print('NO')
	else:
		f = True
		ans = left + mid + right
		for i in range(1, len(ans)):
			if abs(ans[i] - ans[i - 1]) == 1:
				continue
			else:
				f = False
				break
		if f:
			print('YES')
			print(' '.join((str(ans[i]) for i in range(len(ans)))))
		else:
			print('NO')
testcase(1)


def getAns(a, b, c, d):
	if a > b:
		if a - b == 1 and c == 0 and (d == 0):
			print('YES')
			li = []
			li.append(0)
			for i in range(b):
				li.append(1)
				li.append(0)
			print(*li)
			return
		print('NO')
		return
	elif d > c:
		if d - c == 1 and a == 0 and (b == 0):
			print('YES')
			li = []
			li.append(3)
			for i in range(c):
				li.append(2)
				li.append(3)
			print(*li)
			return
		print('NO')
		return
	ogB = b
	ogC = c
	b -= a
	c -= d
	li = []
	diff = abs(b - c)
	if diff <= 1:
		print('YES')
		for i in range(d):
			li.append(3)
			li.append(2)
		for i in range(a):
			li.append(1)
			li.append(0)
		if b > c:
			for i in range(c):
				li.append(1)
				li.append(2)
			li.append(1)
		else:
			for i in range(b):
				li.append(1)
				li.append(2)
			if c > b:
				li.insert(0, 2)
		print(*li)
	else:
		print('NO')
asdf = [int(x) for x in input().split(' ')]
getAns(asdf[0], asdf[1], asdf[2], asdf[3])


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
(a, b, c, d) = map(int, input().split())
block1 = []
block2 = []
block3 = []
for s in range(min(a, b)):
	block1.append('0')
	block1.append('1')
	a -= 1
	b -= 1
for s in range(min(c, d)):
	block3.append('2')
	block3.append('3')
	c -= 1
	d -= 1
for s in range(min(b, c)):
	block2.append('2')
	block2.append('1')
	b -= 1
	c -= 1
for s in range(min(a, 1)):
	block1.append('0')
	a -= 1
for s in range(min(b, 1)):
	block1 = ['1'] + block1
	b -= 1
for s in range(min(c, 1)):
	block3.append('2')
	c -= 1
for s in range(min(d, 1)):
	block3 = ['3'] + block3
	d -= 1
if a > 0 or b > 0 or c > 0 or (d > 0):
	print('NO')
else:
	outy = block1 + block2 + block3
	broke = False
	for s in range(1, len(outy)):
		if abs(int(outy[s]) - int(outy[s - 1])) == 1:
			continue
		else:
			broke = True
			break
	if broke == False:
		print('YES')
		print(' '.join(outy))
	else:
		print('NO')


(a, b, c, d) = map(int, input().split())
if a > b and (d != 0 or c != 0):
	print('NO')
elif a == 1 and b == 0 and (c == 0) and (d == 0):
	print('YES')
	print(0)
elif a == 0 and b == 1 and (c == 0) and (d == 0):
	print('YES')
	print(1)
elif a == 0 and b == 0 and (c == 1) and (d == 0):
	print('YES')
	print(2)
elif a == 0 and b == 0 and (c == 0) and (d == 1):
	print('YES')
	print(3)
elif a == 0 and b == 0:
	ans = []
	if d == c:
		for i in range(c):
			ans.append(2)
			ans.append(3)
		print('YES')
		print(*ans)
	elif c - d == 1:
		for i in range(d):
			ans.append(2)
			ans.append(3)
		ans.append(2)
		print('YES')
		print(*ans)
	elif d - c == 1:
		for i in range(c):
			ans.append(3)
			ans.append(2)
		ans.append(3)
		print('YES')
		print(*ans)
	else:
		print('NO')
elif a == b:
	ans = []
	if d == c or d == c - 1:
		for i in range(a):
			ans.append(0)
			ans.append(1)
		for i in range(d):
			ans.append(2)
			ans.append(3)
		if d == c - 1:
			ans.append(2)
		print('YES')
		print(*ans)
	else:
		print('NO')
else:
	ans = []
	if b - a > c - d:
		for i in range(a):
			ans.append(1)
			ans.append(0)
		ans.append(1)
		if c >= b - a - 1:
			for i in range(b - a - 1):
				ans.append(2)
				ans.append(1)
			if d == c - (b - a - 1) or d == c - (b - a - 1) - 1:
				for i in range(d):
					ans.append(2)
					ans.append(3)
				if d == c - (b - a - 1) - 1:
					ans.append(2)
				print('YES')
				print(*ans)
			else:
				print('NO')
		else:
			print('NO')
	else:
		for i in range(min(a, b)):
			ans.append(0)
			ans.append(1)
		if c >= b - a and c != 0:
			for i in range(b - a):
				ans.append(2)
				ans.append(1)
			if d == c - (b - a) or d == c - (b - a) - 1:
				for i in range(d):
					ans.append(2)
					ans.append(3)
				if d == c - (b - a) - 1:
					ans.append(2)
				print('YES')
				print(*ans)
			else:
				print('NO')
		elif a - b == 1:
			ans.append(0)
			print('YES')
			print(*ans)
		else:
			print('NO')


from sys import stdin, stdout
read = lambda : map(int, stdin.readline().split())
I = lambda : stdin.readline()
(a, b, c, d) = read()
ind = 0 if a + c < b + d else 1
res = [0 for i in range(a)] + [2 for i in range(c)]
for i in range(b):
	res.insert(ind, 1)
	ind += 2
for j in range(d):
	res.insert(ind, 3)
	ind += 2
for i in range(1, len(res)):
	if abs(res[i] - res[i - 1]) != 1:
		print('NO')
		break
else:
	print('YES')
	print(*res)


from itertools import combinations
import sys
input = sys.stdin.readline
INF = 10 ** 9
(a, b, c, d) = [int(item) for item in input().split()]
n = a + b + c + d
if n == 1 and a == 1:
	print('YES')
	print(0)
	exit()
elif n == 1 and d == 1:
	print('YES')
	print(3)
	exit()
diff = a + c - (b + d)
if abs(diff) > 1:
	print('NO')
	exit()
if c == 0 and d == 0:
	if a > b:
		ans = [0] * n
		for i in range(b):
			ans[2 * i + 1] = 1
	else:
		ans = [1] * n
		for i in range(a):
			ans[2 * i + 1] = 0
	print('YES')
	print(' '.join([str(item) for item in ans]))
	exit()
if a == 0 and b == 0:
	if c > d:
		ans = [2] * n
		for i in range(d):
			ans[2 * i + 1] = 3
	else:
		ans = [3] * n
		for i in range(c):
			ans[2 * i + 1] = 2
	print('YES')
	print(' '.join([str(item) for item in ans]))
	exit()
if diff == 1:
	if d > c - 1:
		print('NO')
		exit()
	ans = [2] * n
	for i in range(d):
		ans[i * 2 + 1] = 3
	for i in range(d, d + b):
		ans[i * 2 + 1] = 1
	for i in range(c, c + a):
		ans[i * 2] = 0
	print('YES')
	print(' '.join([str(item) for item in ans]))
	exit()
elif diff == -1:
	if a > b - 1:
		print('NO')
		exit()
	ans = [1] * n
	for i in range(a):
		ans[i * 2 + 1] = 0
	for i in range(a, a + c):
		ans[i * 2 + 1] = 2
	for i in range(b, b + d):
		ans[i * 2] = 3
	print('YES')
	print(' '.join([str(item) for item in ans]))
	exit()
elif diff == 0:
	if a > b or d > c:
		print('NO')
		exit()
	ans = [0] * n
	for i in range(a, a + c):
		ans[i * 2] = 2
	for i in range(b):
		ans[i * 2 + 1] = 1
	for i in range(b, b + d):
		ans[i * 2 + 1] = 3
	print('YES')
	print(' '.join([str(item) for item in ans]))
	exit()


import sys
import math
from collections import defaultdict
from collections import deque
from itertools import combinations
from itertools import permutations
input = lambda : sys.stdin.readline().rstrip()
read = lambda : list(map(int, input().split()))

def write(*args, sep='\n'):
	for i in args:
		sys.stdout.write('{}{}'.format(i, sep))
INF = float('inf')
MOD = int(1000000000.0 + 7)
YES = 'YES'
NO = 'NO'
arr = read()
d = deque()
while 1:
	flag = False
	for i in range(4):
		if arr[i]:
			if not d:
				d.append(i)
				flag = True
				arr[i] -= 1
				break
			else:
				if abs(d[0] - i) == 1:
					d.appendleft(i)
					flag = True
					arr[i] -= 1
					break
				if abs(d[-1] - i) == 1:
					d.append(i)
					flag = True
					arr[i] -= 1
					break
	if flag:
		continue
	else:
		break
if sum(arr) == 0:
	print(YES)
	print(*d, sep=' ')
else:
	print(NO)


def solve(a, e):
	if not a[e]:
		return (False, [])
	a = list(a[:])
	ans = [e]
	a[e] -= 1
	for i in range(sum(a)):
		if ans[-1] - 1 >= 0 and a[ans[-1] - 1] > 0:
			v = ans[-1] - 1
			ans.append(v)
			a[v] -= 1
		elif ans[-1] + 1 <= 3 and a[ans[-1] + 1] > 0:
			v = ans[-1] + 1
			ans.append(v)
			a[v] -= 1
		else:
			return (False, [])
	return (True, ans)

def main():
	a = list(map(int, input().split()))
	for i in range(4):
		(r, b) = solve(a, i)
		if r:
			print('YES')
			print(*b)
			return
	print('NO')
main()


from sys import stdin
input = stdin.readline
(a, b, c, d) = map(int, input().split())
if abs(a + c - b - d) > 1:
	print('NO')
	exit(0)
ans = [-1]
for i in range(a + c):
	if i < c:
		ans.append(2)
		ans.append(-1)
	else:
		ans.append(0)
		ans.append(-1)

def check(lst):
	pre = -1
	for i in lst:
		if pre != -1 and abs(pre - i) != 1:
			return False
		pre = i
	return True
if a + c <= b + d:
	i = 0
	while i // 2 < b + d:
		if i // 2 < d:
			ans[i] = 3
		else:
			ans[i] = 1
		i += 2
	if check(ans[:a + b + c + d]):
		print('YES')
		print(*ans[:a + b + c + d])
	else:
		print('NO')
else:
	i = 2
	while i // 2 - 1 < b + d:
		if i // 2 - 1 < d:
			ans[i] = 3
		else:
			ans[i] = 1
		i += 2
	if check(ans[1:a + b + c + d + 1]):
		print('YES')
		print(*ans[1:a + b + c + d + 1])
	else:
		print('NO')


(a, b, c, d) = map(int, input().split())
seq = []
nums = [a, b, c, d]

def solve(a, b, c, d, second):
	for i in range(3):
		while nums[i] != 0 and nums[i + 1] != 0:
			if len(seq) == 0:
				if second:
					seq.append(i + 1)
					nums[i + 1] -= 1
				else:
					seq.append(i)
					nums[i] -= 1
			elif nums[i] > 0 and (seq[-1] == i - 1 or seq[-1] == i + 1):
				seq.append(i)
				nums[i] -= 1
			elif nums[i + 1] > 0 and seq[-1] == i:
				seq.append(i + 1)
				nums[i + 1] -= 1
			else:
				break
	for i in range(4):
		while nums[i] > 0:
			if len(seq) == 0 or seq[-1] == i - 1 or seq[-1] == i + 1:
				seq.append(i)
				nums[i] -= 1
			elif seq[0] == i - 1 or seq[0] == i + 1:
				seq.insert(0, i)
				nums[i] -= 1
			else:
				break
	if sum(nums) == 0:
		print('YES')
		print(' '.join([str(a) for a in seq]))
		return True
	else:
		return False
if not solve(a, b, c, d, True):
	if not solve(a, b, c, d, False):
		print('NO')


from collections import *
from functools import reduce, cmp_to_key
import sys
input = sys.stdin.readline

def factors(n):
	return sorted(list(set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))))

def li():
	return [int(i) for i in input().rstrip('\n').split(' ')]

def st():
	return input().rstrip('\n')

def val():
	return int(input())

def falsetest(l):
	for i in range(1, len(l)):
		if abs(l[i] - l[i - 1]) != 1:
			return 1
	return 0

def givelist(a, b, c, d, inv):
	l = []
	ans = 1
	while a:
		if b:
			l.append(0)
			l.append(1)
		else:
			break
		b -= 1
		a -= 1
	while b:
		if c:
			l.append(2)
			l.append(1)
		else:
			ans = 0
			break
		b -= 1
		c -= 1
	while c:
		if d:
			l.append(2)
			l.append(3)
		else:
			break
		c -= 1
		d -= 1
	if a:
		l.append(0)
		if len(l) > 1 and abs(l[-1] - l[-2]) != 1:
			ans = 0
		a -= 1
	if d:
		l = [3] + l
		d -= 1
		if len(l) > 1 and abs(l[0] - l[1]) != 1:
			ans = 0
	if c:
		l.append(2)
		c -= 1
	if b:
		l = [1] + l
		b -= 1
	if not ans or d or c or b or a or falsetest(l):
		return 0
	else:
		print('YES')
		if inv:
			temp = []
			for i in l:
				temp.append(3 - i)
			l = temp
		print(*l)
		exit()
(w, x, y, z) = li()
givelist(w, x, y, z, 0)
givelist(z, y, x, w, 1)
print('NO')


import os
import sys
from io import BytesIO, IOBase
from collections import Counter
import math as mt
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)

def lcm(a, b):
	return a * b / gcd(a, b)
mod = int(1000000000.0) + 7

def power(k, n):
	if n == 0:
		return 1
	if n % 2:
		return power(k, n - 1) * k % mod
	t = power(k, n // 2)
	return t * t % mod

def totalPrimeFactors(n):
	count = 0
	if n % 2 == 0:
		count += 1
		while n % 2 == 0:
			n //= 2
	i = 3
	while i * i <= n:
		if n % i == 0:
			count += 1
			while n % i == 0:
				n //= i
		i += 2
	if n > 2:
		count += 1
	return count
ans = []

def check(a, b, c, d):
	global ans
	if a < 0 or b < 0 or c < 0 or (d < 0):
		return
	for i in range(a):
		ans.append(0)
		ans.append(1)
		b -= 1
	if b < 0:
		ans.pop()
		b += 1
	if b > 0:
		for i in range(b):
			ans.append(2)
			ans.append(1)
			c -= 1
	if c > 0:
		for i in range(c):
			ans.append(2)
			ans.append(3)
			d -= 1
	if d == -1:
		ans.pop()
	t = []
	if d > 0:
		for i in range(d):
			t.append(3)
	for i in ans:
		t.append(i)
	ans = []
	for i in t:
		ans.append(i)

def main():
	global ans
	(a, b, c, d) = map(int, input().split())
	t = [a, b, c, d]
	check(a, b, c, d)
	cnt = [0, 0, 0, 0]
	f = 0
	cnt[ans[0]] += 1
	for i in range(1, len(ans)):
		cnt[ans[i]] += 1
		if abs(ans[i] - ans[i - 1]) != 1:
			f = 1
	if f == 0 and cnt == t:
		print('YES')
		print(*ans)
		return
	check(a, b - 1, c, d)
	ans = []
	ans.append(1)
	check(a, b - 1, c, d)
	cnt = [0, 0, 0, 0]
	f = 0
	cnt[ans[0]] += 1
	for i in range(1, len(ans)):
		cnt[ans[i]] += 1
		if abs(ans[i] - ans[i - 1]) != 1:
			f = 1
	if f == 0 and cnt == t:
		print('YES')
		print(*ans)
		return
	print('NO')
	return
main()


import sys
input = sys.stdin.readline
(a, b, c, d) = map(int, input().split())
if a > b + 1:
	print('NO')
elif a == b + 1:
	if c == d == 0:
		print('YES')
		arr = [0] + [1, 0] * b
		print(*arr)
	else:
		print('NO')
elif d > c + 1:
	print('NO')
elif d == c + 1:
	if a == b == 0:
		print('YES')
		arr = [3] + [2, 3] * c
		print(*arr)
	else:
		print('NO')
elif a == b:
	arr = [0, 1] * a
	if c == d:
		print('YES')
		arr.extend([2, 3] * c)
		print(*arr)
	elif c == d + 1:
		print('YES')
		arr.extend([2, 3] * d + [2])
		print(*arr)
	else:
		print('NO')
elif c == d:
	if b == a + 1:
		print('YES')
		arr = [1, 0] * a + [1] + [2, 3] * c
		print(*arr)
	else:
		print('NO')
elif b - a == c - d:
	print('YES')
	arr = [0, 1] * a + [2, 1] * (b - a) + [2, 3] * d
	print(*arr)
elif b - a == c - 1 - d:
	print('YES')
	arr = [0, 1] * a + [2, 1] * (b - a) + [2, 3] * d + [2]
	print(*arr)
elif b - 1 - a == c - d:
	print('YES')
	arr = [1] + [0, 1] * a + [2, 1] * (b - 1 - a) + [2, 3] * d
	print(*arr)
elif b - 1 - a == c - 1 - d:
	print('YES')
	arr = [1] + [0, 1] * a + [2, 1] * (b - 1 - a) + [2, 3] * d + [2]
	print(*arr)
else:
	print('NO')


import sys
input = sys.stdin.readline
(a, b, c, d) = map(int, input().split())
res = 0
str1 = []
str2 = []
str3 = []
if a > 0:
	str1.append('0 ')
	a -= 1
if d > 0:
	str2.append('3 ')
	d = d - 1
res = 0
while a > 0:
	if b > 0:
		str1.append('1 0 ')
		a -= 1
		b -= 1
	else:
		res = -1
		break
while d > 0:
	if c > 0:
		str2.append('2 3 ')
		c -= 1
		d -= 1
	else:
		res = -1
		break
if len(str1) != 0 and len(str2) != 0 and (b == 0 or c == 0):
	res = -1
if len(str1) == 0 and len(str2) != 0 and (c == 0 and b != 0):
	res = -1
if len(str1) != 0 and len(str2) == 0 and (b == 0 and c != 0):
	res = -1
while b > 0 and c > 0:
	str3.append('1 2 ')
	b -= 1
	c -= 1
if b > 0:
	if len(str1) != 0:
		str4 = ['1 ']
		str4.extend(str1)
		str1 = str4
		b -= 1
	if b > 0 and len(str3) == 0:
		str1.append('1 ')
		b -= 1
if b > 0:
	if len(str2) == 0 and len(str3) != 0:
		str3.append('1 ')
		b -= 1
if b > 0:
	res = -1
if c > 0:
	if len(str2) != 0:
		str2.append('2 ')
		c -= 1
	if len(str3) == 0 and c > 0:
		str3.append('2 ')
		c -= 1
if c > 0:
	if len(str1) == 0 and len(str3) != 0 and (str3[0] != '2 '):
		str4 = ['2 ']
		str4.extend(str3)
		str3 = str4
		c -= 1
if c > 0:
	res = -1
ans = ''
if res == 0:
	str1.extend(str3)
	str1.extend(str2)
	print('YES')
	ans = ans.join(str1)
	print(ans)
else:
	print('NO')


(a, b, c, d) = map(int, input().split())
arr = []
for i in range(c):
	arr.append(-1)
	arr.append(2)
for i in range(a):
	arr.append(-1)
	arr.append(0)
arr.append(-1)
la = len(arr)
i = 0
while d > 0 and i < la:
	if arr[i] == -1:
		if i > 0 and i != la - 1 and (arr[i - 1] == 2) and (arr[i + 1] == 2):
			arr[i] = 3
			d -= 1
		elif i == 0 and i != la - 1 and (arr[i + 1] == 2):
			arr[i] = 3
			d -= 1
		elif i == la - 1 and i != 0 and (arr[i - 1] == 2):
			arr[i] = 3
			d -= 1
		elif la - 1 == 0:
			arr[i] = 3
			d -= 1
		i += 1
	else:
		i += 1
i = la - 1
while i >= 0 and b > 0:
	if arr[i] == -1:
		arr[i] = 1
		b -= 1
	i -= 1
flag = 0
for i in range(1, la):
	if arr[i] == -1:
		if i > 0 and i != la - 1 and (arr[i - 1] == 2) and (arr[i + 1] == 2) and (flag == 0) and (arr[0] != -1):
			(arr[i], arr[0]) = (arr[0], arr[i])
			flag = 1
		elif flag == 1 or flag == 0:
			(arr[i], arr[-1]) = (arr[-1], arr[i])
			flag = 2
		elif i != la - 1:
			flag = 777
ans = []
if arr.count(-1) <= 2 and b == 0 and (d == 0) and (flag != 777):
	for i in arr:
		if i != -1:
			ans.append(i)
	flag = 0
	for i in range(1, len(ans)):
		if abs(ans[i] - ans[i - 1]) != 1:
			flag = 777
if flag == 0 and ans:
	print('YES')
	print(*ans)
else:
	print('NO')


(a, b, c, d) = [int(x) for x in input().split()]
if b >= a and c >= d:
	b2 = b - a
	c2 = c - d
	if abs(c2 - b2) <= 1:
		print('YES')
		if c2 == b2:
			print(' '.join('01' * a + '21' * c2 + '23' * d))
		elif c2 == b2 - 1:
			print(' '.join('1' + '01' * a + '21' * (b2 - 1) + '23' * d))
		elif c2 == b2 + 1:
			print(' '.join('2' + '32' * d + '12' * (c2 - 1) + '10' * a))
	else:
		print('NO')
elif d == c + 1 and a == 0 and (b == 0):
	print('YES')
	print(' '.join('32' * c + '3'))
elif a == b + 1 and c == 0 and (d == 0):
	print('YES')
	print(' '.join('01' * b + '0'))
else:
	print('NO')


(a, b, c, d) = map(int, input().split())
(zeros, ones, twos, threes) = (a, b, c, d)
s = a + b + c + d
r = [-1] * s
for i in range(0, s, 2):
	if a > 0:
		r[i] = 0
		a -= 1
	elif c > 0:
		r[i] = 2
		c -= 1
	else:
		break
for i in range(s - 1 - s % 2, -1, -2):
	if d > 0:
		r[i] = 3
		d -= 1
	elif b > 0:
		r[i] = 1
		b -= 1
	else:
		break
result = list(filter(lambda x: x >= 0, r))
penalty = 0
for _ in range(min(b, 2)):
	result = [1] + result
	penalty += 1
b -= penalty
penalty = 0
for _ in range(min(d, 2)):
	result = [3] + result
	penalty += 1
d -= penalty
if len(result) < s or b > 0 or d > 0:
	print('NO')
else:
	f = False
	for i in range(1, s):
		if abs(result[i] - result[i - 1]) != 1:
			f = True
			break
	if not f:
		print('YES')
		print(' '.join(map(str, result)))
	else:
		print('NO')


def main():
	freq = [int(s) for s in input().split()]
	for first in range(4):
		f = [_ for _ in freq]
		if f[first] == 0:
			continue
		res = [first]
		f[first] -= 1
		while True:
			add = 0
			while add < 4 and (f[add] == 0 or res[-1] - add not in {-1, 1}):
				add += 1
			if add == 4:
				if sum(f) == 0:
					print('YES\n' + ' '.join(map(str, res)))
					return
				break
			res.append(add)
			f[add] -= 1
	print('NO')
main()


T = 1
MAX = 3 * 10 ** 5 + 10
for t in range(1, T + 1):
	(a, b, c, d) = map(int, input().split())
	(a_, b_, c_, d_) = (a, b, c, d)
	if a == 0 and b == 0:
		if abs(c - d) > 1:
			print('NO')
			continue
		if c > d:
			print('YES')
			ans = '2 ' * (c - d > 0) + '3 2 ' * d
		else:
			print('YES')
			ans = '3 ' * (d - c > 0) + '2 3 ' * c
	elif d == 0 and c == 0:
		if abs(a - b) > 1:
			print('NO')
			continue
		if a > b:
			print('YES')
			ans = '0 ' * (a - b > 0) + '1 0 ' * b
		else:
			print('YES')
			ans = '1 ' * (b - a > 0) + '0 1 ' * a
	else:
		if b < a or c < d:
			print('NO')
			continue
		b -= a
		c -= d
		minval = min(b, c)
		b -= minval
		c -= minval
		if b > 1 or c > 1:
			print('NO')
			continue
		print('YES')
		ans = '1 ' * b + '0 1 ' * a + '2 1 ' * minval + '2 3 ' * d + '2 ' * c
	print(ans)
	x = list(map(int, ans.split()))
	assert x.count(0) == a_ and x.count(1) == b_ and (x.count(2) == c_) and (x.count(3) == d_)
	for i in range(1, len(x)):
		assert abs(x[i] - x[i - 1]) == 1


(a, b, c, d) = list(map(int, input().split()))
n1 = a
n2 = b
n3 = c
n4 = d
l = list()
a1 = a
a2 = b
c1 = 0
c2 = 1
k = 0
f = 1
g1 = 1
g2 = 1
ans1 = 1
for i in range(0, a + b + c + d):
	if a == 0 and g1:
		g1 = 0
		a = c
		c1 = 2
	if b == 0 and g2:
		g2 = 0
		b = d
		c2 = 3
	if i % 2 == 0:
		if a == 0:
			ans1 = 0
		l.append(c1)
		k = k + 1
		a = a - 1
	else:
		if b == 0:
			ans1 = 0
		l.append(c2)
		k = k + 1
		b = b - 1
for i in range(0, k - 1):
	if abs(l[i + 1] - l[i]) != 1:
		f = 0
		break
if f and ans1 == 1:
	print('YES')
	print(*l)
	exit()
else:
	ans1 = 0
ans2 = 1
a = n1
b = n2
c = n3
d = n4
l = list()
a1 = a
a2 = b
(b, a) = (a, b)
c1 = 1
c2 = 0
k = 0
f = 1
g1 = 1
g2 = 1
for i in range(0, a + b + c + d):
	if a == 0 and g1:
		g1 = 0
		a = d
		c1 = 3
	if b == 0 and g2:
		g2 = 0
		b = c
		c2 = 2
	if i % 2 == 0:
		if a == 0:
			ans2 = 0
		l.append(c1)
		k = k + 1
		a = a - 1
	else:
		if b == 0:
			ans2 = 0
		l.append(c2)
		k = k + 1
		b = b - 1
for i in range(0, k - 1):
	if abs(l[i + 1] - l[i]) != 1:
		f = 0
		break
if f and ans2 == 1:
	print('YES')
	print(*l)
	exit()
else:
	ans2 = 0
print('NO')


def weave(a, b, na, nb):
	aNext = True
	arr = []
	while True:
		if aNext:
			if a == 0:
				break
			arr.append(na)
			a -= 1
		else:
			if b == 0:
				break
			arr.append(nb)
			b -= 1
		aNext = not aNext
	return arr

def main():
	(a, b, c, d) = readIntArr()
	(A, B, C, D) = (a, b, c, d)
	left = weave(a, b, 0, 1)
	rightReversed = weave(d, c, 3, 2)
	for x in left:
		if x == 0:
			a -= 1
		else:
			b -= 1
	for x in rightReversed:
		if x == 2:
			c -= 1
		else:
			d -= 1
	if len(left) == 0 and a == 0 and (b == 0):
		if d > 0:
			print('NO')
			return
		if c == 1:
			rightReversed.insert(0, 2)
			c -= 1
		if c == 0:
			print('YES')
			oneLineArrayPrint(rightReversed)
		else:
			print('NO')
		return
	if len(rightReversed) == 0 and c == 0 and (d == 0):
		if a > 0:
			print('NO')
			return
		if b == 1:
			left.insert(0, 1)
			b -= 1
		if b == 0:
			print('YES')
			oneLineArrayPrint(left)
		else:
			print('NO')
		return
	if len(left) == 0 or left[-1] != 1:
		if b == 0:
			print('NO')
			return
		left.append(1)
		b -= 1
	if len(rightReversed) == 0 or rightReversed[-1] != 2:
		if c == 0:
			print('NO')
			return
		rightReversed.append(2)
		c -= 1
	if abs(b - c) > 2:
		print('NO')
		return
	if b - c > 0:
		if left[0] == 0:
			left.insert(0, 1)
			b -= 1
	if b - c > 0:
		if rightReversed[0] == 2:
			rightReversed.insert(0, 1)
			b -= 1
	if c - b > 0:
		if left[0] == 1:
			left.insert(0, 2)
			c -= 1
	if c - b > 0:
		if rightReversed[0] == 3:
			rightReversed.insert(0, 2)
			c -= 1
	if c != b:
		print('NO')
		return
	for _ in range(b):
		left.append(2)
		left.append(1)
	ans = left + list(reversed(rightReversed))
	print('YES')
	oneLineArrayPrint(ans)
	assert A == ans.count(0) and B == ans.count(1) and (C == ans.count(2)) and (D == ans.count(3))
	return
import sys
input = lambda : sys.stdin.readline().rstrip('\r\n')

def oneLineArrayPrint(arr):
	print(' '.join([str(x) for x in arr]))

def multiLineArrayPrint(arr):
	print('\n'.join([str(x) for x in arr]))

def multiLineArrayOfArraysPrint(arr):
	print('\n'.join([' '.join([str(x) for x in y]) for y in arr]))

def readIntArr():
	return [int(x) for x in input().split()]

def makeArr(defaultVal, dimensionArr):
	dv = defaultVal
	da = dimensionArr
	if len(da) == 1:
		return [dv for _ in range(da[0])]
	else:
		return [makeArr(dv, da[1:]) for _ in range(da[0])]

def queryInteractive(x, y):
	print('? {} {}'.format(x, y))
	sys.stdout.flush()
	return int(input())

def answerInteractive(ans):
	print('! {}'.format(ans))
	sys.stdout.flush()
inf = float('inf')
MOD = 10 ** 9 + 7
for _abc in range(1):
	main()


(a, b, c, d) = map(int, input().split())
sol = []
if a == 0 and b == 0:
	if abs(c - d) <= 1:
		if c == d:
			for i in range(c):
				sol.append(2)
				sol.append(3)
		elif c == d + 1:
			for i in range(d):
				sol.append(2)
				sol.append(3)
			sol.append(2)
		elif d == c + 1:
			for i in range(c):
				sol.append(3)
				sol.append(2)
			sol.append(3)
		print('YES')
		print(*sol)
	else:
		print('NO')
elif c == 0 and d == 0:
	if abs(a - b) <= 1:
		if a == b:
			for i in range(a):
				sol.append(0)
				sol.append(1)
		elif a == b + 1:
			for i in range(b):
				sol.append(0)
				sol.append(1)
			sol.append(0)
		elif b == a + 1:
			for i in range(a):
				sol.append(1)
				sol.append(0)
			sol.append(1)
		print('YES')
		print(*sol)
	else:
		print('NO')
else:
	(b1, b2, c1, c2) = (-1, -1, -1, -1)
	found = False
	for i in range(0, min(b, c) + 1):
		b2 = i
		c1 = i
		b1 = b - b2
		c2 = c - c1
		if (a == b1 or a + 1 == b1) and (d == c2 or d + 1 == c2):
			found = True
			break
	if found:
		if a == b1:
			for i in range(a):
				sol.append(0)
				sol.append(1)
		else:
			for i in range(a):
				sol.append(1)
				sol.append(0)
			sol.append(1)
		for i in range(b2):
			sol.append(2)
			sol.append(1)
		if c2 == d:
			for i in range(d):
				sol.append(2)
				sol.append(3)
		else:
			for i in range(d):
				sol.append(2)
				sol.append(3)
			sol.append(2)
		print('YES')
		print(*sol)
	else:
		print('NO')


def find_start_old(freq):
	largest = max(freq)
	if freq.count(largest) == 1 or freq[0] == largest:
		return freq.index(largest)
	if freq[-1] == largest:
		return 3
	if freq[0] > freq[-1]:
		return 2
	return 1

def find_start(freq):
	temp = [0] + freq + [0]
	diff = [temp[i] - temp[i - 1] - temp[i + 1] for i in range(1, len(temp) - 1)]
	return diff.index(max(diff))

def populate(freq, start):
	result = []
	while freq.count(0) != 4:
		if freq[start] == 0:
			return (False, [])
		result.append(str(start))
		freq[start] -= 1
		if start == 0 or (start == 1 and freq[0] == 0) or (start == 2 and freq[3] != 0):
			start += 1
		else:
			start -= 1
	return (True, ' '.join(result))
freq = [int(i) for i in input().split()]
for i in range(4):
	(exists, string) = populate(freq[:], i)
	if exists:
		print('YES')
		print(string)
		break
if not exists:
	print('NO')


from math import *
from collections import *
import sys
sys.setrecursionlimit(10 ** 9)
(a, b, c, d) = map(int, input().split())
ans = []
flag = 0
while a > 0:
	ans.append(0)
	a -= 1
	if b > 0:
		ans.append(1)
		b -= 1
if b < 0:
	flag = 1
while b > 0:
	if c > 0:
		ans.append(2)
		c -= 1
	ans.append(1)
	b -= 1
if c < 0:
	flag = 1
while c > 0:
	ans.append(2)
	c -= 1
	if d > 0:
		ans.append(3)
		d -= 1
if d != 0 or c != 0:
	if d == 1:
		ans.insert(0, 1)
		n = len(ans)
		for i in range(n - 1, -1, -1):
			if ans[i] == 1:
				ans[i] = 3
				break
	else:
		flag = 1
n = len(ans)
if n > 1 and ans[n - 1] == 1 and (ans[n - 2] == 1):
	ans.pop()
	ans.insert(0, 1)
for i in range(n - 1):
	if abs(ans[i + 1] - ans[i]) != 1:
		flag = 1
		break
if flag == 1:
	print('NO')
else:
	print('YES')
	for i in ans:
		print(i, end=' ')
	print()