Created
September 17, 2017 06:00
-
-
Save asuka-mirai/d551e26a580374a5ba65fe318efd53ea to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
N =int(input()) | |
l = [int(input()) for _ in range(3)] | |
if N in l: | |
print('NO') | |
else: | |
flag = False | |
for i in range(100): | |
if N <= 3: | |
flag = True | |
break | |
elif N-3 not in l: | |
N -= 3 | |
elif N-2 not in l: | |
N -= 2 | |
elif N-1 not in l: | |
N -= 1 | |
else: | |
break | |
print('YES' if flag else 'NO') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment