qyliang/CodeNanoFix huggingface dataset:
Title: Sunrise and Sunset

Sunrise refers to the appearance of the sun, while sunset refers to its disappearance. The precise timing depends on the sun's position relative to the horizon.

Consider the sun as a circle and the horizon as a straight line. The moments of sunrise and sunset occur when the top of the sun's circle aligns with the horizon line. After sunrise, the period when the top of the circle is above the line is daytime, while the time when the circle is completely below the line is nighttime.

Given the height from the horizon to the center of the sun and the sun's radius, create a program to determine whether it is daytime, sunrise/sunset, or nighttime.

Input:
A single line containing an integer H (-1000 ≤ H ≤ 1000) representing the height from the horizon to the center of the sun at a specific time, and an integer R (1 ≤ R ≤ 1000) representing the sun's radius. H is 0 when the sun's center is on the horizon, positive when above, and negative when below.

Output:
Print "1" for daytime, "0" for sunrise/sunset, and "-1" for nighttime.

Sample Input 1:
-3 3

Sample Output 1:
0

Sample Input 2:
3 3

Sample Output 2:
1

Sample Input 3:
-4 3

Sample Output 3:
-1

# Buggy version:
h, r = map(int, input().split())
if h + r < 0:print(-1)
else:print(0 if h == r else 1)


# Fixed version:
h,r=map(int,input().split())
if h+r==0:
    print('0')
elif h+r<0:
    print('-1')
else:
    print('1')
The problem discusses the conversion between the Western calendar ("Gregorian calendar") and the Japanese calendar ("Imperial calendar"). It requires creating a program to convert a given year from one calendar system to the other. The input consists of a calendar type (0 for Gregorian, 1-4 for different eras in the Japanese calendar) and a year. The output should display the converted year, with a prefix indicating the era for the Gregorian to Japanese conversion. The problem provides specific era ranges for each calendar type. Four sample inputs and their corresponding outputs are also provided.

# Buggy version:
E,Y = map(int,input().split())

if E ==0:
    if 1911>Y:
        print("M"+str(Y-1867))
    elif 1925>Y:
        print("T"+str(Y-1911))
    elif 1988>Y:
        print("S"+str(Y-1925))
    else:
        print("H"+str(Y-1988))
elif E==1:
    print(1868+Y)
elif E==2:
    print(1912+Y)
elif E==3:
    print(1926+Y)
else:
    print(1989+Y)



# Fixed version:
E,Y = map(int,input().split())

if E ==0:
    if 1912>Y:
        print("M"+str(Y-1867))
    elif 1926>Y:
        print("T"+str(Y-1911))
    elif 1989>Y:
        print("S"+str(Y-1925))
    else:
        print("H"+str(Y-1988))
elif E==1:
    print(1867+Y)
elif E==2:
    print(1911+Y)
elif E==3:
    print(1925+Y)
else:
    print(1988+Y)
Title: Shape Data Processing

In computer graphics, the polygon model is used to represent three-dimensional shapes. This model consists of vertex coordinates and the connections between these vertices to create surfaces.

For this problem, we consider a polygon model consisting of triangles. Any polygon model can be represented as a collection of surface information representing triangles.

Each surface information is represented by arranging three vertices. However, if the arrangement of vertices is different, but the same three points are used, it is considered the same surface information. For example, in the given tetrahedron, the surface created by connecting vertices 1, 2, and 3 can also be represented as vertices 2, 3, 1 or vertices 3, 2, 1. To avoid redundancy, it is better to consolidate such duplicate surface information.

Given the surface information, create a program to determine the number of surface information that needs to be removed to eliminate duplicate surfaces.

Input:
The input is given in the following format:
N
p11 p12 p13
p21 p22 p23
...
pN1 pN2 pN3

The first line contains the number of surface information N (1 ≤ N ≤ 1000). The following N lines contain the vertex numbers pij (1 ≤ pij ≤ 1000) used to create the ith surface. For each surface, the same vertex is not used more than twice (pi1 ≠ pi2 and pi2 ≠ pi3 and pi1 ≠ pi3).

Output:
Output the number of surface information that needs to be removed to eliminate duplicate surfaces in a single line.

Sample Input 1:
4
1 3 2
1 2 4
1 4 3
2 3 4

Sample Output 1:
0

Sample Input 2:
6
1 3 2
1 2 4
1 4 3
2 3 4
3 2 1
2 3 1

Sample Output 2:
2

In the second example, the first, fifth, and sixth surfaces use vertices 1, 3, 2 to create a triangle, differing only in the order of points, thus resulting in duplicates. Therefore, removing two surfaces will eliminate the duplicate surfaces.

# Buggy version:
# encoding: 'utf-8'

N = int(input())
ls = list()
for _ in range(N):
    e = sorted([int(x) for x in split(input())])
    if e in ls:
        continue
    else:
        ls.append(e)
print(N - len(ls))

# Fixed version:
# encoding: 'utf-8'

N = int(input())
ls = list()

for _ in range(N):
    e = sorted([int(x) for x in input().split()])
    if e in ls:
        continue
    else:
        ls.append(e)
print(N - len(ls))
Title: Creating a Rectangle

In the educational program "Asonde Tsukuro" by the Japan Broadcasting Corporation (NHK Education), a children's craft program is broadcast. In today's episode, the challenge is to create a rectangle using four sticks without cutting or folding them.

Input:
The input consists of a single line containing the lengths of the four sticks represented by integers e1, e2, e3, and e4 (1 ≤ ei ≤ 100).

Output:
Output "yes" if it is possible to create a rectangle using the given sticks, and "no" if it is not possible. Note that a square is considered a type of rectangle, so for a square, the output should still be "yes".

Sample Input 1:
1 1 3 4

Sample Output 1:
no

Sample Input 2:
1 1 2 2

Sample Output 2:
yes

Sample Input 3:
2 1 1 2

Sample Output 3:
yes

Sample Input 4:
4 4 4 10

Sample Output 4:
no

# Buggy version:
lst=list(input().split())
if lst[0]==lst[1] and lst[2]==lst[3]:
  print('yes')
else:
   print('no')

# Fixed version:
lst=list(input().split())
lst.sort()
if lst[0]==lst[1] and lst[2]==lst[3]:
  print('yes')
else:
   print('no')

# Buggy version:
e = sorted(map(int, input().split()))
print("yes" if e[0] == e[1] and e[2] == e[3])

# Fixed version:
e = sorted(map(int, input().split()))
print("yes" if e[0] == e[1] and e[2] == e[3] else "no")
Title: Making a Rectangular Prism with Sticks

The educational program "Assemble and Create" for children, broadcasted by the Aizu Broadcasting Association (AHK Education), features an episode on making boxes with sticks. The challenge is to determine if it's possible to create a rectangular prism using 12 sticks without cutting or bending them.

Input:
A single line containing the lengths of 12 sticks represented as integers e1, e2, ..., e12 (1 ≤ ei ≤ 100).

Output:
Output "yes" if it's possible to create a rectangular prism, including a cube, using the given sticks. Otherwise, output "no".

Sample Input 1:
1 1 3 4 8 9 7 3 4 5 5 5

Sample Output 1:
no

Sample Input 2:
1 1 2 2 3 1 2 3 3 3 1 2

Sample Output 2:
yes

# Buggy version:
ls = list(map(int, input().split()))
ls.sort()
if ls[0]==ls[1]==ls[2]==ls[3] and ls[4==ls[5]==ls[6]==ls[7] and ls[8]==ls[9]==ls[10]==ls[11]:
    print('yes')
else:
    print('no')

# Fixed version:
ls = list(map(int, input().split()))
ls.sort()
if ls[0]==ls[1]==ls[2]==ls[3] and ls[4]==ls[5]==ls[6]==ls[7] and ls[8]==ls[9]==ls[10]==ls[11]:
    print('yes')
else:
    print('no')

# Buggy version:
lst=list(input().split())
lst.sort()
if lst[0]==lst[1]==lst[2]==lst[3] and lst[4]==lst[5]==lst[6]==lst[7] and
lst[8]==lst[9]==lst[10]==lst[11]:
  print('yes')
else:
   print('no')

# Fixed version:
l=list(input().split())
l.sort()
if l[0]==l[1]==l[2]==l[3] and l[4]==l[5]==l[6]==l[7]and l[8]==l[9]==l[10]==l[11]:
  print('yes')
else:
   print('no')

# Buggy version:
e = list(map(int, input().split()))
print("yes" if len(set(e[:4])) == len(set(e[4:8])) == len(set(e[8:])) == 1 else "no")

# Fixed version:
e = sorted(map(int, input().split()))
print("yes" if len(set(e[:4])) == len(set(e[4:8])) == len(set(e[8:])) == 1 else "no")

# Buggy version:
li = list(map(int,input().split()))
so = sorted(li)
a = so[0]
b = so[4]
c = so[8]
for n in so[:4]:
    res1=  a==n
for n in so[4:8]:
    res2=  b==n
for n in so[8:]:
    res3= c==n
res = 'yes' if res1 and res3 and res2 else 'no'



# Fixed version:
li = list(map(int,input().split()))
so = sorted(li)
a = so[0]
b = so[4]
c = so[8]
for n in so[:4]:
    res1=  a==n
for n in so[4:8]:
    res2=  b==n
for n in so[8:]:
    res3= c==n
res = 'yes' if res1 and res3 and res2 else 'no'
print(res)
Title: Handsel
New Year’s gift money

Alice and Brown, siblings, receive pocket money for the upcoming year. They share the total amount equally, with each receiving a multiple of 1,000 yen. 

Write a program to calculate the share of money for Alice and Brown based on the amounts they receive.

Input:
Two values, a and b, representing the money received by Alice and Brown, respectively. (1000 ≤ a, b ≤ 50000)

Output:
Display the amount of money each of Alice and Brown receives on a separate line.

Sample Input 1:
1000 3000

Sample Output 1:
2000

Sample Input 2:
5000 5000

Sample Output 2:
5000

Sample Input 3:
1000 2000

Sample Output 3:
1500

# Buggy version:
# coding=utf-8

a, b = map(int, input().split())
print((a+b)/2)



# Fixed version:
# coding=utf-8

a, b = map(int, input().split())
print((a+b)//2)

# Buggy version:
print(sum(map(int,input().split()))/2)

# Fixed version:
print(sum(map(int,input().split()))//2)

# Buggy version:
a, b = map(int, input().split())



print((a + b) / 2)


# Fixed version:
a, b = map(int, input().split())
print((a + b) // 2)
Title: Shopping

You and your friend Alice are in a bookshop to buy a newly released book, "The Winning Strategy for the Programming Koshien Contest." You plan to borrow money from Alice if the amount you have is not enough to cover the book's price. Write a program to calculate the minimum amount of money you need to borrow from Alice, given your current money and the book's price.

Input:
Three integers representing the money you have (m), the money Alice has (f), and the price of the book (b). (0 ≤ m, f ≤ 10000, 100 ≤ b ≤ 20000)

Output:
Print the minimum amount of money you need to borrow from Alice. If Alice's money is insufficient, output "NA."

Sample Input 1:
1000 3000 3000

Sample Output 1:
2000

Sample Input 2:
5000 3000 4500

Sample Output 2:
0

Sample Input 3:
500 1000 2000

Sample Output 3:
NA

# Buggy version:
m,f,b=map(int,input().split())
ans=0
if m>b:
    ans=0
elif m<b:
    ans=b-m
elif ans>f:
    ans="NA"
print(ans)


# Fixed version:
m,f,b=map(int,input().split())

if m>b:
   print(0)

elif b-m<=f:
   print(b-m)
else:
   print("NA")

# Buggy version:
m,f,b=map(int,input().split())
ans=0
if m>b:
    ans=0
elif m<b:
    ans=b-m
elif m+f<b:
    ans="NA"
print(ans)


# Fixed version:
m, f, b = map(int, input().split())

if m + f < b:
    print("NA")
elif m >= b:
    print(0)
else:
    print(b - m)
Celsius/Fahrenheit

In Japan, temperature is usually expressed using the Celsius (℃) scale. In America, they use the Fahrenheit (℉) scale instead. 20 degrees Celsius is roughly equal to 68 degrees Fahrenheit. A phrase such as "Today’s temperature is 68 degrees" is commonly encountered while you are in America.

A value in Fahrenheit can be converted to Celsius by first subtracting 32 and then multiplying by 5/9. A simplified method may be used to produce a rough estimate: first subtract 30 and then divide by 2. Using the latter method, 68 Fahrenheit is converted to 19 Centigrade, i.e., (68-30)/2.

Make a program to convert Fahrenheit to Celsius using the simplified method: C = (F - 30)/2.

Input
The input is given in the following format.

F

The input line provides a temperature in Fahrenheit F (30 ≤ F ≤ 100), which is an integer divisible by 2.

Output
Output the converted Celsius temperature in a line.

Sample Input 1
68

Sample Output 1
19

Sample Input 2
50

Sample Output 2
10

# Buggy version:
a=int(input())
print((a-30)/2)


# Fixed version:
a = int(input())
print((a-30)//2)

# Buggy version:
print((int(input())-30)/2)


# Fixed version:
print(int((int(input())-30) / 2))
Title: Party Dress

Yae is embarking on a journey with multiple parties planned along the way. She aims to attend all the parties and will carry a certain number of dresses with her. However, the number of dresses she can carry may be fewer than the number of parties, necessitating the reuse of some dresses. Yae, being fashion-conscious, wants to minimize the maximum frequency of wearing the same dress.

Write a program to determine how she can reduce the maximum frequency of wearing the most reused dress.

Input:
The input consists of two integers, A and B, representing the number of dresses (1 ≤ A ≤ 10^5) and the frequency of parties (1 ≤ B ≤ 10^5).

Output:
Output the frequency at which she has to wear the most reused dress.

Sample Input 1:
3 5

Sample Output 1:
2

Sample Input 2:
25 10

Sample Output 2:
1

# Buggy version:
A, B = map(int, input().split())
print((B+A-1)/A)



# Fixed version:
A, B = map(int, input().split())
print((B+A-1)//A)
Design a Mansion:
Our master carpenter is designing a condominium called Bange Hills Mansion. The condominium is constructed by stacking up floors of the same height. The height of each floor is designed so that the total height of the stacked floors coincides with the predetermined height of the condominium. The height of each floor can be adjusted freely with a certain range. The final outcome of the building depends on clever height allotment for each floor. So, he plans to calculate possible combinations of per-floor heights to check how many options he has. Given the height of the condominium and the adjustable range of each floor’s height, make a program to enumerate the number of choices for a floor.

Input:
The input is given in the following format:
H A B
The input line provides the height of the condominium H (1 ≤ H ≤ 10^5) and the upper and lower limits A and B of the height adjustable range for one floor (1 ≤ A ≤ B ≤ H). All data are given as integers.

Output:
Output the number of possible height selections for each floor in a line.

Sample Input 1:
100 2 4

Sample Output 1:
2

Sample Input 2:
101 3 5

Sample Output 2:
0

# Buggy version:
H,a,b=map(int,input().split())
c=0
for i in range(a,b):
  if H%i==0 :
    c+=1
print(c)


# Fixed version:
h,a,b=map(int,input().split())
c=0
for i in range(a,b+1):
    if h%i==0:
        c=c+1
print(c)
Pilling Blocks:
We construct a tower by stacking blocks, with each stage built by connecting blocks horizontally. All blocks have the same weight and can withstand the weight of up to K blocks without crushing.

Conditions:
- Each stage has at least one block.
- The weight on each block falls within its withstanding range, calculated as the total weight of all blocks above the stage divided by the number of blocks within the stage.

Given the number of blocks (N) and their strength (K), create a program to determine the maximum tower height (stages).

Input:
N K

Output:
Maximum number of stages.

Sample Input 1:
4 2

Sample Output 1:
3

Sample Input 2:
5 2

Sample Output 2:
4

# Buggy version:
N,K = map(int, input().split())
t = n = a = 1
while True:
    n = (K+a-1)/K
    a += n;
    if  N < a: break
    t += 1
print(t)


# Fixed version:
N,K = map(int, input().split())
t = n = a = 1
while True:
    n = (K+a-1)//K
    a += n;
    if  N < a: break
    t += 1
print(t)
Title: Sum of Decimal Digits

Given positive integers a, b, and n, consider the fraction a / b. Let f(i) denote the i-th decimal digit of this fraction, where 0 ≤ f(i) ≤ 9. Calculate the sum, s, of f(i) from i = 1 to n.

Input:
The input consists of multiple datasets. Each dataset contains three integers a (1 ≤ a ≤ 1000), b (1 ≤ b ≤ 10000), and n (1 ≤ n ≤ 100) separated by a single space.

The number of datasets does not exceed 100.

Output:
For each dataset, output s on a new line.

Sample Input:
1 2 3
2 3 4
5 4 3
4 3 2

Output for the Sample Input:
5
24
7
6

# Buggy version:
while True:
    try:
        a, b, n = map(int, input().split())
    except:
        break

    s = str(a/b)
    sum = 0
    x = s.index(".")+1
    for i in s[x:2+x]:
        sum += int(i)

    print(sum)

# Fixed version:
while True:
    try:
        a, b, n = map(int, input().split())
    except:
        break

    s = str(a/b)
    sum = 0
    x = s.index(".")+1
    for i in s[x:x+n]:
        sum += int(i)

    print(sum)
Title: Number of Regions

On an infinitely large plane, drawing several infinitely long lines divides the plane into multiple regions. For instance, drawing one line divides the plane into two regions. The number of regions obtained by drawing the same number of lines varies depending on how the lines are drawn. For example, drawing 2 parallel lines results in 3 regions, while drawing them perpendicular to each other results in 4 regions.

Create a program to output the maximum number of regions obtained by drawing n lines.

Input:
Multiple datasets are provided. Each dataset contains n (1 ≤ n ≤ 10,000) on a single line. Process until the end of the input. The number of datasets does not exceed 50.

Output:
For each dataset, output the maximum number of divisions on a single line.

Sample Input:
1
3

Output for the Sample Input:
2
7

# Buggy version:
while True:
    try:
        a = int(input())
        print(str(((a * a) + a + 2) / 2))
    except EOFError:
        break

# Fixed version:
while True:
    try:
        a = int(input())
        print(str(int(((a * a) + a + 2) / 2)))
    except EOFError:
        break

# Buggy version:
import sys
lc=lambda n:int((n**2+n+2)/2)
[print(i) for i in [lc(int(j)) for j in sts.stdin]]


# Fixed version:
import sys
lc=lambda n:int((n**2+n+2)/2)
[print(i) for i in [lc(int(j)) for j in sys.stdin]]
Title: Orthogonal Determination

Problem:
Read the coordinates of four different points on a plane, $A (x_A, y_A)$, $B (x_B, y_B)$, $C (x_C, y_C)$, $D (x_D, y_D)$. Create a program to determine if the lines $AB$ and $CD$ are orthogonal. Output "YES" if they are orthogonal, and "NO" if they are not. Note that "line" refers to a line segment, not a straight line.

Input:
Multiple datasets are provided. Each dataset is in the format:
$x_A$ $y_A$ $x_B$ $y_B$ $x_C$ $y_C$ $x_D$ $y_D$

$x_A$, $y_A$, $x_B$, $y_B$, $x_C$, $y_C$, $x_D$, $y_D$ are real numbers between -100 and 100, each with up to 5 decimal places.

The number of datasets does not exceed 100.

Output:
For each dataset, output "YES" or "NO" on a single line.

Sample Input:
1.0 1.0 2.0 2.0 0.0 0.0 1.0 -1.0
0.0 0.0 2.0 0.0 -1.0 2.0 2.0 2.0
10.0 6.0 3.4 5.2 6.8 9.5 4.3 2.1
2.5 3.5 2.5 4.5 -3.3 -2.3 6.8 -2.3

Output for the Sample Input:
YES
NO
NO
YES

# Buggy version:
while True:
    try:
        x_a, y_a, x_b, y_b, x_c, y_c, x_d, y_d = map(float, input().split(","))
        ab_x, ab_y = x_b - x_a, y_b - y_a
        cd_x, cd_y = x_d - x_c, y_d - y_c
        dp = ab_x*cd_x + ab_y*cd_y
        if dp:
            print("NO")
        else:
            print("YES")
    except:
        break



# Fixed version:
while True:
    try:
        x_a, y_a, x_b, y_b, x_c, y_c, x_d, y_d = map(float, input().split())
        ab_x, ab_y = x_b - x_a, y_b - y_a
        cd_x, cd_y = x_d - x_c, y_d - y_c
        dp = ab_x*cd_x + ab_y*cd_y
        if abs(dp) > 1e-10:
            print("NO")
        else:
            print("YES")
    except:
        break
Title: Rectangle Overlap

There are two rectangles with bases parallel to the x-axis. Given the coordinates of the bottom-left and top-right corners of rectangle A (<var>xa1</var>, <var>ya1</var>), (<var>xa2</var>, <var>ya2</var>), and rectangle B (<var>xb1</var>, <var>yb1</var>), (<var>xb2</var>, <var>yb2</var>), create a program that outputs YES if rectangles A and B overlap at least partially, and NO if they do not overlap at all. Rectangles A and B are not the same, and touching is considered overlapping.

Input:
Multiple datasets are provided. Each dataset is in the following format:
<var>xa1</var> <var>ya1</var> <var>xa2</var> <var>ya2</var> <var>xb1</var> <var>yb1</var> <var>xb2</var> <var>yb2</var>
The input values are real numbers ranging from -2,000 to 2,000, each with up to 5 decimal places.

The number of datasets does not exceed 50.

Output:
For each dataset, output YES or NO on a single line.

Sample Input:
0.0 0.0 5.0 5.0 1.0 1.0 4.0 4.0
0.0 0.0 4.0 5.0 1.0 1.0 5.0 5.0
0.0 0.0 4.0 4.0 -3.0 -5.0 2.0 -1.0

Output for the Sample Input:
YES
YES
NO

# Buggy version:
def solve(xa,ya1,xa1,ya2,xb1,yb1,xb2,yb2):
	if xb2<xa1 or xb1>xa2 or yb2<ya1 or yb1>yb2:
		print("NO")
	else:
		print("YES")


while True:
	try:
		xa,ya1,xa1,ya2,xb1,yb1,xb2,yb2=map(float,input().split())
		solve(xa,ya1,xa1,ya2,xb1,yb1,xb2,yb2)
	except EOFError:
		break

# Fixed version:
while True:
    try:
        xa1,ya1,xa2,ya2,xb1,yb1,xb2,yb2=map(float,input().split())
    except EOFError:
        break
    if xb2<xa1 or xb1>xa2 or yb2<ya1 or yb1>ya2:
        print("NO")
    else:
        print("YES")
Title: Card Game

There are 10 cards numbered from 1 to 10. Each card has a number on one side and nothing on the other. You and an opponent will play a game using these cards with the following rules:
1. Each player receives one card face up and one card face down. You can see your opponent's face-up card but not the face-down card.
2. The winner is the player with a total card value of 20 or less, and whose total is greater than the opponent's. For example, if your cards are "7" and "8" (total 15) and your opponent's cards are "9" and "10" (total 19), your opponent wins.
3. You and your opponent can draw one more card at most, but it's not mandatory.

To decide whether to draw another card, consider the probability of the total being 20 or less after drawing. If the probability is 50% or higher, draw a card. You can use the information of your two cards and your opponent's face-up card to calculate this probability.

Create a program that reads your two cards and your opponent's face-up card, and outputs "YES" if the probability of the total being 20 or less after drawing is 50% or higher, and "NO" otherwise.

Input:
The input consists of multiple datasets. Each dataset is in the format: C1 C2 C3, where C1 and C2 are your card numbers, and C3 is your opponent's face-up card number.

Output:
For each dataset, output "YES" or "NO" on a separate line.

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

Sample Output:
YES
YES
NO

# Buggy version:
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")

# Fixed version:
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")

# Buggy version:
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')

# Fixed version:
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])