import sys
N1, N2, N3, N4 = map(str, input().split())
tmp = N1 + N2 + N3 + N4
for i in '1974':
    if tmp.count(i) != 1:
        print('NO')
        sys.exit()
print('YES')

1d2ffe857ca313cb11149e1aae08ad3dd11421e3
<mask token>

<mask token>
for i in '1974':
    if tmp.count(i) != 1:
        print('NO')
        sys.exit()
print('YES')

<mask token>
N1, N2, N3, N4 = map(str, input().split())
tmp = N1 + N2 + N3 + N4
for i in '1974':
    if tmp.count(i) != 1:
        print('NO')
        sys.exit()
print('YES')

import sys
N1, N2, N3, N4 = map(str, input().split())
tmp = N1 + N2 + N3 + N4
for i in '1974':
    if tmp.count(i) != 1:
        print('NO')
        sys.exit()
print('YES')
