Problem:


カードゲー ム

「1」から「10」までの数字が書かれたカードが各 1 枚、全部で 10 枚あります。このカードは、表側には数字が書かれ、裏側には何も書かれていません。このカードを使って、あなたと相手の 2 名で以下のルールでゲー ムを行います。

   
 あなたと相手には、表を上にして 1 枚、裏を上にして 1 枚、計 2 枚のカードが配られています。あなたは相手の表のカードの数字を見ることができますが、裏のカードの数字は見えません。

   
 配られたカードの数字の合計が 20 以下で、かつ相手の数字の合計より大きいときに勝ちとなります。
      例えば、あなたのカードが「7」「8」 (合計 15) 、相手のカードが「9」「10」 (合計 19) のときは、相手の勝ちです。

   
 あなたと相手は最大であと 1 枚カードを引くことができます。それを引かなくても構いません。

  ここで、あと 1 枚のカードを引くかどうかを決定する目安として、カードを引いたときに合計が 20 以下に なる確率を考え、その確率が 50% 以上のときはカードを引くこととしましょう。この確率を計算するときには、あなたの 2 枚のカードと相手の表のカードの計3枚のカードの情報を利用することができます。つまり、各カードは 1 枚ずつしかないので、それらのカードを引くことはないことになります。

あなたの 2 枚のカードと相手の表のカードを読み込んで、それぞれについて、あと 1 枚引いたときに合計が 20 以下になる確率が 50% 以上のときは YES、そうでないなら NO を出力するプログラムを作成してください。

Input

入力は複数のデータセットからなります。 1 枚目のあなたのカードの数字を C1 、2 枚目のあなたのカードの数字を C2 、相手の表になっているカードの数字を C3 とすると、各データセットは以下の形式で与えられます。

C1 C2 C3

Output

各データセットに対して、YES または NO を１行に出力して下さい。

Sample Input

1 2 3
5 6 9
8 9 10

Output for the Sample Input

YES
YES
NO



Sample input:
1 2 3
5 6 9
8 9 10


Sample output:
YES
YES
NO

Submission status: Wrong Answer

Solution code:
while True:
	try:
		c1, c2, c3 = list(map(int,input().split()))
	except:
		break
	deck = [i for i in range(1,11) if i != c1 and i != c2 and i != c3]
	if 20 - c1 - c2 > max(deck) or 20 - c1 - c2 == c3:
		print("YES")
	else:
		print("NO")

Submission status: Wrong Answer

Solution code:
while True:
	try:
		c1, c2, c3 = list(map(int,input().split()))
	except:
		break
	deck = [i for i in range(1,11) if i != c1 and i != c2 and i != c3]
	if 20 - c1 - c2 > max(deck):
		print("YES")
	elif 20 - c1 - c2 == c3:
		print("YES")
	else:
		print("NO")

Submission status: Wrong Answer

Solution code:
while True:
	try:
		c1, c2, c3 = list(map(int,input().split()))
	except:
		break
	deck = [i for i in range(1,11) if i != c1 and i != c2 and i != c3]
	if 20 - c1 - c2 >= max(deck):
		print("YES")
	elif 20 - c1 - c2 == c3:
		print("YES")
	else:
		print("NO")

Submission status: Wrong Answer

Solution code:
while True:
	try: c1, c2, c3 = list(map(int,input().split()))
	except: break
	countw = 0
	deck = [i for i in range(1,11) if i != c1 and i != c2 and i != c3]
	for i in range(len(deck)):
		eq = c1 + c2 + deck[i]
		if eq > 20: 
			break
		countw +=1
	print(["YES","NO"][countw <=4])

Submission status: Wrong Answer

Solution code:
while True:
	try: c1, c2, c3 = list(map(int,input().split()))
	except: break
	countw = 0
	deck = [i for i in range(1,11) if i != c1 and i != c2 and i != c3]
	for i in range(len(deck)):
		eq = 0
		eq = c1 + c2 + deck[i]
		if eq > 20: 
			break
		countw +=1
	print(["YES","NO"][countw <=4])

Submission status: Wrong Answer

Solution code:
while True:
	try: c1, c2, c3 = list(map(int,input().split()))
	except: break
	countw = 0
	deck = [i for i in range(1,11) if i != c1 and i != c2 and i != c3]
	for i in range(len(deck)):
		eq = 0
		eq = c1 + c2 + deck[i]
		if eq > 20: 
			break
		countw +=1
	print(["YES","NO"][countw <= 5])

Submission status: Wrong Answer

Solution code:
while True:
    try:
        a, b, c = map(int, input().split())
    except:
        break

    l=[True] * 11
    l[a] = l[b] = l[c] = False
    sum = a + b
    over = 0

    for i in range(1,11):
        if l[i]:
            if sum + i >= 20:
                over += 1

    if over / 7 < 0.5:
        print("YES")
    else:
        print("NO")

Submission status: Wrong Answer

Solution code:
while True:
    try:
        a, b, c = map(int, input().split())
    except:
        break

    l=[True] * 11
    l[a] = l[b] = l[c] = False
    sum = a + b
    over = 0

    for i in range(1,11):
        if l[i]:
            if sum + i >= 20:
                over += 1

    if over / 7 <= 0.5:
        print("YES")
    else:
        print("NO")

Submission status: Wrong Answer

Solution code:
while True:
    try:
        a, b, c = map(int, input().split())
    except:
        break

    l=[True] * 11
    l[a] = l[b] = l[c] = False
    sum = a + b
    over = 0

    for i in range(1,11):
        if l[i]:
            if sum + i > 20:
                print(i)
                over += 1

    if over / 7 <= 0.5:
        print("YES")
    else:
        print("NO")

Submission status: Wrong Answer

Solution code:
while 1:
    try:
        c=map(int,raw_input().split())
        sumc=c[0]+c[1]
        cnt=0
        for i in xrange(1,11):
            if i in c:continue
            if sumc+i<20:
                cnt+=1
        if cnt/7.0>=0.5:
            print('YES')
        else:
            print('NO')
    except:
        break

Submission status: Wrong Answer

Solution code:
while 1:
    try:
        c=map(int,raw_input().split())
        sumc=c[0]+c[1]
        cnt=0
        for i in xrange(1,11):
            if i in c:continue
            if sumc+i<20:
                cnt+=1
        if cnt>=4:
            print('YES')
        else:
            print('NO')
    except:
        break

Submission status: Wrong Answer

Solution code:
while True:
    try:
        card_now=list(map(int,input().split()))
        print ("YES" if (55-sum(card_now))/7  <= 20-sum(card_now[0:2]) else "NO")
    except:
        break

Submission status: Wrong Answer

Solution code:
while True:
    try:
        C1, C2, C3 = map(int, input().split())
    except:
        break
    cards = [v for v in range(1, 11)]
    p = []
    for v in [C1, C2, C3]:
        cards.remove(v)
    for i in cards:
        _card = cards[:]
        _card.remove(i)
        for j in _card:
            if C1+C2+j <= 20:
                p.append(1)
            else:
                p.append(0)
    print(sum(p)/len(p))

Submission status: Wrong Answer

Solution code:
import sys
for line in sys.stdin:
    if line == "\n":
        break
    c1, c2, c3 = map(int, line.split())
    cnt = 0
    for i in range(1, 11):
        if i == c1 or i == c2 or i == c3:
            continue
        else:
            if c1 + c2 + i <= 20:
                cnt += 1
    if cnt >= 4:
        print("Yes")
    else:
        print("No")

Submission status: Wrong Answer

Solution code:
while 1:
    try: a,b,c=input()
    except: break
    x=20-a-b
    f=3
    if x<a: f-=1
    if x<b: f-=1
    if x<c: f-=1
    print ["NO","YES"][x-f>=4]

Submission status: Wrong Answer

Solution code:
while 1:
    try:
        a, b, c = map(int, raw_input().split())
    except EOFError:
        break
    cards = set(xrange(1, 11))
    cards -= {a, b, c}
    ret = 0.0
    for card in cards:
        ret += card * 1.0 / len(cards)
    if ret < 20 - a - b:
        print "YES"
    else:
        print "NO"

Submission status: Accepted

Solution code:
import sys
for c1, c2, c3 in (map(int, l.split()) for l in sys.stdin.readlines()):
    available = set(range(1, 11)) - {c1, c2, c3}
    if len([1 for n in available if 20-c1-c2 >= n]) >= 4:
        print("YES")
    else:
        print("NO")

Submission status: Accepted

Solution code:
while True:
	try: c1, c2, c3 = list(map(int,input().split()))
	except: break
	safe = 20 - (c1 + c2)
	deck = [i for i in range(1,11) if i <= safe and i != c1 and i != c2 and i != c3]
	print(["YES","NO"][len(deck) / 7 <= 0.5])

Submission status: Accepted

Solution code:
while True:
    try:
        c1, c2, c3 = map(int, input().split())
    except:
        break
    nums = list(set([i + 1 for i in range(10)]) ^ set([c1, c2, c3]))
    hit = 0
    for n in nums:
        if c1 + c2 + n <= 20: hit += 1

    if hit / 7 >= 0.5:
        print('YES')
    else:
        print('NO')

Submission status: Accepted

Solution code:
import sys

for s in sys.stdin:
    c1,c2,c3 = map(int,s.split())
    county=countn=0
    for i in xrange(1,10) :
        if i in [c1,c2,c3] :continue
        if c1+c2+i <= 20: county += 1
        else : countn += 1
    if county/float(countn+county) >= 0.5 : print "YES"
    else: print "NO"

Submission status: Accepted

Solution code:
import sys
f = sys.stdin

for line in f:
    c1, c2, c3 = map(int, line.split())
    cards = set([i + 1 for i in range(10)])
    cards.remove(c1)
    cards.remove(c2)
    cards.remove(c3)
   
    print( 'YES' if 0.5 <= sum(1 for i in cards if c1 + c2 + i <= 20) / len(cards) else 'NO')

Submission status: Accepted

Solution code:
while True:
    try:
        a, b, c = map(int, input().split())
    except:
        break

    l=[True] * 11
    l[a] = l[b] = l[c] = False
    sum = a + b
    over = 0

    for i in range(1,11):
        if l[i]:
            if sum + i > 20:
                over += 1

    if over / 7 < 0.5:
        print("YES")
    else:
        print("NO")

Submission status: Accepted

Solution code:
while True:
    try:
        c1,c2,c3 = map(int, raw_input().split())
        count = 0
        for i in range(10):
            num = i+1
            if num != c1 and num != c2 and num != c3:
                if c1+c2+num <= 20:
                    count += 1
            if count >= 4:
                print 'YES'
                break
        else:
            print 'NO'
        
    except EOFError:
        break

Submission status: Accepted

Solution code:
while True:
    try:
        c1,c2,c3 = map(int,raw_input().split())
        count = 0
        for i in xrange(10):
            temp = i + 1
            if temp != c1 and temp != c2 and temp != c3 and  c1 + c2 + temp <= 20:
            	count += 1
            if count >= 4:
                print "YES"
                break
        else:
            print "NO"
         
    except EOFError:
        break

Submission status: Accepted

Solution code:
import sys
for line in sys.stdin.readlines():
  c1,c2,c3 = line.split()
  c1,c2,c3 = int(c1),int(c2),int(c3)
  l = [i for i in range(1,11) if i != c1 and i != c2 and i != c3]
  s = c1 + c2
  count = 0
  for i in l:
    if s + i <= 20:
      count += 1
  if count >= 4:
    print('YES')
  else:
    print('NO')

Submission status: Accepted

Solution code:
while 1:
    try:
        l=set(range(1,11))
        a,b,c=map(int,raw_input().split())
        t=a+b
        l=l-set([a,b,c])
        cnt=0
        for i in l:
            if t+i<=20:
                cnt+=1
        print 'YES' if cnt>3 else 'NO'
    except:
        break

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

import sys

for line in sys.stdin:
    c1, c2, c3 = map(int, line.split())
    mysum = c1+c2
    count = 0
    for i in range(1, 11):
        if i == c1 or i == c2 or i == c3:
            continue
        if mysum + i <= 20:
            count += 1
    if count > 3:
        print "YES"
    else:
        print "NO"

Submission status: Accepted

Solution code:
while 1:
    try:
        c=map(int,raw_input().split())
        sumc=c[0]+c[1]
        cnt=0
        for i in xrange(1,11):
            if i in c:continue
            if sumc+i<=20:
                cnt+=1
        if cnt>=4:
            print('YES')
        else:
            print('NO')
    except:
        break

Submission status: Accepted

Solution code:
while True:
    try:
        c1, c2, c3 = map(int, input().split())
    except:
        break
    nums = [i for i in range(1, 11)]
    for c in [c1, c2, c3]:
        nums.remove(c)
    cnt = 0
    for num in nums:
        if num + c1 + c2 <= 20:
            cnt += 1
    print('YES' if cnt > 3 else 'NO')

Submission status: Accepted

Solution code:
while True:
    try:
        ok=0
        ng=0
        card_now=list(map(int,input().split()))
        total=sum(card_now[:2])
        for i in range (1,11):
            if i not in card_now:
                if total + i <= 20:
                    ok += 1
                else:
                    ng += 1
        print ("YES" if ok > ng else "NO")
                    
        
    except:
        break

Submission status: Accepted

Solution code:
while 1:
    a=[i+1 for i in range(10)]
    try:b=list(map(int,input().split()))
    except:break
    s=20-sum(b[:2])
    for i in range(3):a.pop(a.index(b[i]))
    print('YES' if sum([1 for i in a if i<=s])/7>=0.5 else 'NO')

Submission status: Accepted

Solution code:
while 1:
    a=[i+1 for i in range(10)]
    try:b=list(map(int,input().split()))
    except:break
    for i in range(3):a.remove(b[i])
    print('YES' if sum([1 for i in a if i<=20-sum(b[:2])])/7>=0.5 else 'NO')

Submission status: Accepted

Solution code:
while 1:
    a=[i+1 for i in range(10)]
    try:b=list(map(int,input().split()))
    except:break
    for i in b:a.remove(i)
    print('YES' if sum([1 for i in a if i<=20-sum(b[:2])])/7>=0.5 else 'NO')

Submission status: Accepted

Solution code:
while 1:
    a=[i+1 for i in range(10)]
    try:b=list(map(int,input().split()))
    except:break
    for i in b:a.remove(i)
    print(['NO','YES'][sum([1 for i in a if sum(b[:2],i)<=20])/7>=0.5])

Submission status: Accepted

Solution code:
while 1:
    a=[i+1 for i in range(10)]
    try:b=list(map(int,input().split()))
    except:break
    for i in b:a.remove(i)
    c=sum(b[:2])
    print(['NO','YES'][sum([1 for i in a if c+i<=20])/7>=0.5])

Submission status: Accepted

Solution code:
def drawone(f):
    v = list(range(1,11))
    for i in f:
        v.remove(i)
    win = 0
    lose= 0
    for i in v:
        if i + sum(f[:2]) <= 20:
            win += 1
        else:
            lose += 1
    return(True if win>=lose else False)

while True:
    try:
        f = list(map(int,input().strip().split()))
        if drawone(f):
            print('YES')
        else:
            print('NO')
    except EOFError:
        break

Submission status: Accepted

Solution code:
while True:
    try:
        x,y,z = map(int,input().split())
    except EOFError:
        break
    cnt = 0
    for i in range(1,10):
        if i == x or i == y or i == z:
            continue
        if x + y + i <= 20:
            cnt += 1
    if cnt >= 4:
        print('YES')
    else:
        print('NO')

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

import sys
import os

for s in sys.stdin:
    C1, C2, C3 = map(int, s.split())

    cards = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
    cards.remove(C1)
    cards.remove(C2)
    cards.remove(C3)

    capacity = 20 - C1 - C2
    want_cards = [card for card in cards if card <= capacity]

    if len(want_cards) / len(cards) >= 0.5:
        print('YES')
    else:
        print('NO')

Submission status: Accepted

Solution code:
while True:
    try:
        C1, C2, C3 = map(int, input().split())
    except:
        break
    cards = [v for v in range(1, 11)]
    p = []
    for v in [C1, C2, C3]:
        cards.remove(v)
    for i in cards:
        _card = cards[:]
        _card.remove(i)
        for j in _card:
            if C1+C2+j <= 20:
                p.append(1)
            else:
                p.append(0)
    print("YES" if sum(p)/len(p) >= 0.5 else "NO")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0060
"""
import sys



def calc_possibility(open_cards):
    cards = [x for x in range(1, 11)]
    c1, c2, c3 = open_cards
    my_total = c1 + c2
    cards.remove(c1)
    cards.remove(c2)
    cards.remove(c3)

    combinations = 0
    hit = 0
    for c in cards:
        combinations += 1
        if my_total + c <= 20:
            hit += 1
    # print('{}/{}'.format(hit, combinations))
    return (hit / combinations >= 0.5)


def main(args):
    for line in sys.stdin:
        open_cards = [int(x) for x in line.strip().split(' ')]
        if calc_possibility(open_cards):
            print('YES')
        else:
            print('NO')



if __name__ == '__main__':
    main(sys.argv[1:])

Submission status: Accepted

Solution code:
# Aizu Problem 0060: Card Game
#
import sys, math, os

# read input:
PYDEV = os.environ.get('PYDEV')
if PYDEV=="True":
    sys.stdin = open("sample-input.txt", "rt")


def card_game(c1, c2, c3):
    cards = list(range(1, 11))
    for card in [c1, c2, c3]:
        cards.remove(card)
    S = c1 + c2
    cnt = 0
    for card in cards:
        if S + card <= 20:
            cnt += 1
    return cnt > 3
        

    
for line in sys.stdin:
    c1, c2, c3 = [int(_) for _ in line.split()]
    print("YES" if card_game(c1, c2, c3) else "NO")

Submission status: Accepted

Solution code:
import sys

allCards = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]

for line in sys.stdin:
  try:
    a, b, c = [int(i) for i in line.split()]
    safe = 20 - (a + b)
    safeCards = [i for i in allCards if i <= safe and i != a and i != b and i != c]
    print("YES" if len(safeCards) / 7 >= 0.5 else "NO")
  except:
    break

Submission status: Accepted

Solution code:
while True:
    try:
        card = set([1,2,3,4,5,6,7,8,9,10])
        c1, c2, c3 = map(int, input().split())
        card_now = card - set([c1,c2,c3])
        p = 0
        for c in card_now:
            if c + c1 + c2 <= 20:
                p += 1
        if p/7 >= 0.5:
            print("YES")
        else:
            print("NO")
    except:
        break

Submission status: Accepted

Solution code:
def get_input():
    while True:
        try:
            yield ''.join(input())
        except EOFError:
            break

N = list(get_input())
for l in range(len(N)):
    cards = [1 for i in range(11)]
    cards[0] = 0
    C1,C2,C3 = [int(i) for i in N[l].split()]
    cards[C1] = 0
    cards[C2] = 0
    cards[C3] = 0

    point = C1+C2
    ok = 0
    ng = 0

    for i in range(1,11):
        if cards[i] == 1 and C1+C2+i <= 20:
            ok += 1
        elif cards[i] == 1:
            ng += 1

    if ok >= ng:
        print("YES")
    else:
        print("NO")

Submission status: Accepted

Solution code:
import sys
for x in sys.stdin:
 e=list(map(int,x.split()))
 s=set(range(1,11))-set(e)
 print(['YES','NO'][sum(20>=sum(e[:2],i)for i in s)/len(s)<.5])

Submission status: Accepted

Solution code:
import sys
for x in sys.stdin:
 e=list(map(int,x.split()))
 print(['YES','NO'][len(set(range(1,21-sum(e[:2])))-set(e))/7<.5])

Submission status: Accepted

Solution code:
import sys
for x in sys.stdin:
 a,b,c=list(map(int,x.split()))
 print(['YES','NO'][len(set(range(1,21-a-b))-{a,b,c})<3.5])

Submission status: Accepted

Solution code:
import sys
for x in sys.stdin:
 e=list(map(int,x.split()))
 a,b,_=e
 print(['YES','NO'][len(set(range(1,21-a-b))-{*e})<3.5])

Submission status: Accepted

Solution code:
import sys
for x in sys.stdin:
 a,b,c=map(int,x.split())
 print(['YES','NO'][len(set(range(1,21-a-b))-{a,b,c})<3.5])

Submission status: Accepted

Solution code:
import sys
for x in sys.stdin:
 a,b,c=map(int,x.split())
 print(['YES','NO'][len({*range(1,21-a-b)}-{a,b,c})<3.5])

Submission status: Accepted

Solution code:
while True:
  try:
    c1, c2, c3 = map(int, input().split())
    lst = [i for i in range(1,11) if i not in (c1, c2, c3) and i + c1 + c2 <= 20]
    if len(lst) >= 4:
      print("YES")
    else:
      print("NO")

  except EOFError:
    break

Submission status: Accepted

Solution code:
import sys
def shu(j):
    t=list(set((range(1,11)))-set(j))
    if sum([1 for i in t if sum(j[:2])+i<=20])/len(t)>0.5:
        return "YES"
    else:
        return "NO"
    
[print(shu(i)) for i in [list(map(int,l.split())) for l in sys.stdin]]

Submission status: Accepted

Solution code:
# AOJ 0060: Card Game
# Python3 2018.6.16 bal4u

while True:
	try: c1, c2, c3 = list(map(int, input().split()))
	except: break
	
	c = [True]*11
	c[c1] = c[c2] = c[c3] = False
	win, my = 0, c1+c2
	for i in range(1, 11):
		if c[i] and my + i <= 20: win += 1
	print('YES' if win >= 4 else 'NO')

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# coding: utf-8

import sys


def get_answer(param):
    yes_count = 0
    for i in [i for i in xrange(1, 11) if i not in param]:
        if param[0] + param[1] + i <= 20:
            yes_count += 1
    return ("NO", "YES")[yes_count >= 4]


def main():
    params = [map(int, line.split(" ")) for line in sys.stdin.readlines()]

    for param in params:
        print get_answer(param)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
for line in sys.stdin.readlines():
    line=map(int,line.strip().split())
    cards=range(1,11)
    m=sum(line[0:2])
    for x in line:
        cards.remove(x)
    c=0
    for x in cards:
       if  m+x<21:c+=1
    if c>len(cards)/2:print "YES"
    else:print "NO"

Submission status: Accepted

Solution code:

import sys


def solv(c1, c2, c3):
    cards = range(1, 11)
    for c in [c1, c2, c3]:
        cards.remove(c)
    hand = c1 + c2
    r = filter(lambda x: x + hand <= 20, cards)
    if len(r) >= 4:
        return 'YES'
    else:
        return 'NO'



for line in sys.stdin:
    c1, c2, c3 = map(int, line.strip().split(' '))
    print solv(c1, c2, c3)

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import (division, absolute_import, print_function,
                        unicode_literals)
from sys import stdin

for line in stdin:
    c = [int(s) for s in line.split()]
    cards = [i for i in range(1, 11) if i not in c]

    c1c2 = c[0] + c[1]
    e = sum(int(i + c1c2 <= 20) for i in cards)
    print('YES' if e > 3 else 'NO')

Submission status: Accepted

Solution code:
import sys
for s in sys.stdin:
    C=[0]+[1]*10
    a,b,c=map(int,s.split())
    C[a]=0
    C[b]=0
    C[c]=0
    if sum(C[:21-a-b])>=4:print "YES"
    else: print "NO"

Submission status: Accepted

Solution code:
import sys
for s in sys.stdin:
    a,b,c=map(int,s.split())
    x=20-a-b
    f=3
    if x<a: f-=1
    if x<b: f-=1
    if x<c: f-=1
    if x-f>=4:print "YES"
    else: print "NO"

Submission status: Accepted

Solution code:
while True:
    try:
        a,b,c = map(int, raw_input().split())
        s = a+b
        count = 0
        for i in range(1,11):
            if i != a and i != b and i != c:
                if s + i <= 20:
                    count += 1 
        print "YES" if count > 3 else "NO"
    except:
        break

Submission status: Accepted

Solution code:
import sys
for s in sys.stdin:
    A=map(int,s.split())
    x=20-A[0]-A[1]
    f=3
    for e in A:
        if x<e: f-=1
    print ["NO","YES"][x-f>=4]

Submission status: Accepted

Solution code:
try:
    while True:
        a = map(int, raw_input().split())
        if len([i for i in range(1, 11) if i not in a and sum(a[:2]) + i <= 20]) > 3:
            print 'YES'
        else:
            print 'NO'
except EOFError:
    pass

Submission status: Accepted

Solution code:
while True:
  try:
    count = 0
    c1, c2, c3 = map(int, raw_input().split())
    for i in range(1, 11):
      if i in [c1, c2, c3]: continue
      if c1 + c2 + i <= 20: count += 1

    if count/7.0 >= 0.5:
      print 'YES'
    else:
      print 'NO'
  except:
    break

Submission status: Accepted

Solution code:
while 1:
    try:
        a, b, c = map(int, raw_input().split())
    except EOFError:
        break
    cards = set(xrange(1, 11))
    cards -= {a, b, c}
    ret = 0.0
    rest = 20 - a - b
    for card in cards:
        if rest >= card:
            ret += 1
    if ret / 7.0 >= 0.5:
        print "YES"
    else:
        print "NO"

Submission status: Accepted

Solution code:
while True:
    try:
        c1, c2, c3 = map(int, input().split())
    except:
        break

    N = list(range(1,11))
    N.remove(c1)
    N.remove(c2)
    N.remove(c3)
    y = 0
    n = 0
    for i in range(7):
        S = c1 + c2 + N[i]
        if S<=20:
            y += 1
        if 20<S:
            n += 1
    j = y/(y+n)
    if 0.5<=j:
        print('YES')
    else:
        print('NO')

Submission status: Accepted

Solution code:
while True:
    try:
        Clst = list(map(int, input().split()))
        mynum = 21 - (Clst[0] + Clst[1])
        a = list(range(1, min(11, mynum)))

        for i in Clst:
            if i in a:
                a.remove(i)
        
        if len(a)/7 >= 0.5 :
            print('YES')
        else:
            print('NO')


    except EOFError:
        break

Submission status: Accepted

Solution code:
while 1:
    try:
        d = list(int(_) for _ in input().split())
        s = d[0] + d[1]
        p = 0
        ans = "NO"
        for i in range(1,11):
            if i != d[0] and i != d[1] and i != d[2]:
                if s + i <= 20:
                    p += 1
        if p / 7 >= 0.5:
            ans = "YES"                
        print(ans)
    except:
        break

Submission status: Accepted

Solution code:
while True :
    try :
        c1, c2, c3 = map(int, input().split())
    except EOFError :
        break
    
    n = 20 - c1 - c2
    ans = n
    if c1 <= n :
        ans -= 1
    if c2 <= n :
        ans -= 1
    if c3 <= n :
        ans -= 1
    if ans >= 4 :
        print("YES")
    else :
        print("NO")

Submission status: Accepted

Solution code:
import sys
readlines = sys.stdin.readlines
write = sys.stdout.write
def solve():
    for line in readlines():
        U = [0]*11
        a, b, c = map(int, line.split())
        U[a] = U[b] = U[c] = 1
        res = 0
        for x in range(1, 11):
            if U[x]:
                continue
            if a + b + x <= 20:
                res += 1
        if res*2 > 7:
            write("YES\n")
        else:
            write("NO\n")
solve()

Submission status: Accepted

Solution code:
#表　数字
#裏　白紙
#「1～10」のカードで同じカードは引けない
def judge(c1,c2,c3):
    num=[i for i in range(1,11) if i!=c1 or i!=c2 or i!=c3]
    if c1+c2<=14:
        return True
    elif c1+c2>=17:
        return False
    tmp=0
    for x in range(20-c1-c2,0,-1):
        if x in num:
            tmp+=1
        if tmp>=4:
            return True
    return False
        
while True:
    try:
        c1,c2,c3=map(int,input().split())
    except EOFError:
        break
    if judge(c1,c2,c3)==True:
        print("YES")
    else:
        print("NO")

Submission status: Accepted

Solution code:
while 1:
    try:
        a, b, c = map(float, input().split())
        cnt1 = 0
        s1 = list(range(1, 11))

        s1.remove(a)
        s1.remove(b)
        s1.remove(c)
        for i in s1:
            if a + b + i <= 20:
                cnt1 += 1

        if cnt1 / 8 >= 0.5:
            print('YES')
        else:
            print('NO')

    except:
        break

Submission status: Accepted

Solution code:
while 1:
    try:
        number=[1,2,3,4,5,6,7,8,9,10]
        C1,C2,C3=map(int,input().split())
        number.remove(C1)
        number.remove(C2)
        number.remove(C3)
        my_sum=C1+C2
        count=0
        for i in number:
            if my_sum+i>20:
                count +=1
        if count/len(number)<0.5:print("YES")
        else:print("NO")
    except:break

Submission status: Accepted

Solution code:
while 1:
    try:
        n=list(map(int,input().split()))
        card=[1,2,3,4,5,6,7,8,9,10]
        if sum(n[0:2])<11:
            print("YES")
        else:
            card.remove(n[0])
            card.remove(n[1])
            card.remove(n[2])
            margin=20-sum(n[0:2])
            if card[3]<=margin:
                print("YES")
            else:
                print("NO")
    except:break

Submission status: Accepted

Solution code:
while(1):
    try:
        c1,c2,c3 = [int(i) for i in input().split()]
        tot = [i for i in range(1,11)]
        tot.remove(c1);tot.remove(c2),tot.remove(c3)
        tot = [i + c1+c2 for i in tot]
        count = [1 if i <= 20 else 0 for i in tot]
        if sum(count) > 3:
            print("YES")
        else:
            print("NO")
    except EOFError:
        break

Submission status: Accepted

Solution code:
while 1:
    try:
        C1, C2, C3 = map(int, input().split())
    except:
        break

    card = list(range(1, 11))

    card.remove(C1)
    card.remove(C2)
    card.remove(C3)

    cnt = 0
    for c in card:
        sum = C1 + C2 + c
        if sum <= 20:
            cnt += 1

    if cnt > 3:
        print("YES")
    else:
        print("NO")

Submission status: Runtime Error

Solution code:
while True:
	c1, c2, c3 = list(map(int,input().split()))
	deck = [i for i in range(1,11) if i != c1 and i != c2 and i != c3]
	if 20 - c1 - c2 > max(deck) or 20 - c1 - c2 == c3:
		print("YES")
	else:
		print("NO")

Submission status: Runtime Error

Solution code:
while True:
    try:
        a, b, c = map(int, input().split())
    except:
        break
    l=[True] * 11
    l[a] = l[b] = l[c] = False
    sum = a + b
    over = 0

    fpr i in range(1,11):
        if l[i]:
            if sum + i >= 20:
                over += 1

    if over / 7 < 0.5:
        print("YES")
    else:
        print("NO")

Submission status: Runtime Error

Solution code:
while 1:
    a=[i+1 for i in range(10)]
    try:b=list(map(int,input().split()))
    except:break
    for i in b:a.remove(b)
    print('YES' if sum([1 for i in a if i<=20-sum(b[:2])])/7>=0.5 else 'NO')

Submission status: Runtime Error

Solution code:
def drawone(f):
    v = list(range(1,11))
    for i in f:
        v.remove(i)
    win = 0
    lose= 0
    for i in v:
        if i + sum(f[:2]) <= 20:
            win += 1
        else:
            lose += 1
    return(True if win>=lose else False)

while True:
    f = list(map(int,input().strip().split()))
    if drawone(f):
        print('YES')
    else:
        print('NO')

Submission status: Runtime Error

Solution code:
import sys
for x in sys.stdin:
 a,b,c=list(map(int,x.split()))
 print(['YES','NO'][len(set(range(1,21-sum(a,b)))-{a,b,c})/7<.5])

Submission status: Runtime Error

Solution code:
import sys
def solve(xa1,ya1,xa2,ya2,xb1,yb1,xb2,yb2):
    if xa1<=yb1 and yb1<=ya2 and xb1<=xa2 and ya1<=yb2:
        return 'YES'
    return 'NO'

for line in sys.stdin.readlines():
    f=map(float, line.split())
    print solve(*f)