TnT/CodeNet4Repair huggingface dataset:
Problem:
Let's first write a program to calculate the score from a pair of input and output. You can know the total score by submitting your solution, or an official program to calculate a score is often provided for local evaluation as in this contest. Nevertheless, writing a score calculator by yourself is still useful to check your understanding of the problem specification. Moreover, the source code of the score calculator can often be reused for solving the problem or debugging your solution. So it is worthwhile to write a score calculator unless it is very complicated.

Incorrect submission (verdict: Wrong Answer):
D=int(input())
*c,=map(int,input().split())

ci=[(c[i-1],i) for i in range(1,27)]
ci=[(0,0)]+sorted(ci,reverse=True)

last=[[0]*27]*(D+1)
S=[[0]*27]*(D+1)
DP=[[0]*27]*(D+1)
T=[0]*(D+1)

for d in range(1,D+1):
    *S[d],=map(int,input().split())
    S[d]=[0]+S[d]
    
for d in range(1,D+1):
  T[d] = int(input())

def do_id(i,d):
    dn=0
    for k in range(1,27):
      if k!=i:
        dn += ci[k][0]*(d-last[d][k])
    return S[d][i]-dn

Satis=0  
for d in range(1,D+1):
  Satis+=do_id(T[d],d)
  print(Satis)
  
def cal():  
  for d in range(1,D+1):
    mxid=0
    mxi,mxd=0,0
    for i in range(1,27):
      doid=do_id(i,d)
      if doid>mxid:
           mxid=doid
           mxi,mxd=i,d
    DP[mxd][mxi]=mxid             
    last[mxd][mxi]=d
  print(DP)    
 

Fixed, accepted submission:
D=int(input())
*c,=map(int,input().split())
# for Greedy
ci=[(c[i-1],i) for i in range(1,27)]
ci=[(0,0)]+ci


last=[[0]*27]*(D+1)
S=[[0]*27]*(D+1)
DP=[[0]*27]*(D+1)
T=[0]*(D+1)

for d in range(1,D+1):
    *S[d],=map(int,input().split())
    S[d]=[0]+S[d]
    
for d in range(1,D+1):
    T[d] = int(input())

def do_id(i,d):
    dn=0
    last[d][i]=d    
    for k in range(1,27):
      if k!=i:
        dn += ci[k][0]*(d-last[d][k])
    return S[d][i]-dn

Satis=0  
for d in range(1,D+1):
    Satis+=do_id(T[d],d)
    print(Satis)
  
def cal():  
  for d in range(1,D+1):
    mxid=0
    mxi,mxd=0,0
    for i in range(1,27):
      tc,ti=ci[i]
      doid=do_id(ti,d)
      if doid>mxid:
           mxid=doid
           mxi,mxd=ti,d
    DP[mxd][mxi]=mxid             
    last[mxd][mxi]=d
  print(DP)
Problem:
We ask you to select some number of positive integers, and calculate the sum of them.  It is allowed to select as many integers as you like, and as large integers as you wish. You have to follow these, however: each selected integer needs to be a multiple of A, and you need to select at least one integer.  Your objective is to make the sum congruent to C modulo B. Determine whether this is possible.  If the objective is achievable, print `YES`. Otherwise, print `NO`.

Incorrect submission (verdict: Wrong Answer):
A, B, C = map(int, input().split())
lis = list(range(1, 1000))
for i in lis:
    if (A*i)%B == C:
        print('Yes')
else:
    print('No')

Fixed, accepted submission:
A, B, C = map(int, input().split())
ans = 'NO'
for i in range(1, 10000):
    if (A*i) % B == C:
        ans ='YES'

print(ans)
Problem:
Takahashi has a deposit of 100 yen (the currency of Japan) in AtCoder Bank.  The bank pays an annual interest rate of 1 % compounded annually. (A fraction of less than one yen is discarded.)  Assuming that nothing other than the interest affects Takahashi's balance, in how many years does the balance reach X yen or above for the first time?

Incorrect submission (verdict: Wrong Answer):
n = int(input())
poket = 100
count = 0

while poket <= n:
    poket = poket + int(poket*0.01)
    count += 1

print(count)

Fixed, accepted submission:
n = int(input())
poket = 100
count = 0

while True:
    poket += int(poket*0.01)
    count += 1
    if(poket>=n):
        break
    
print(count)
Problem:
You are given two integers A and B as the input. Output the value of A + B.  However, if A + B is 10 or greater, output `error` instead.

Incorrect submission (verdict: Wrong Answer):
a,b = map(int, input().split())
print(a+b if a+b>=10 else "error")

Fixed, accepted submission:
a,b = map(int, input().split())
print(a+b if a+b<10 else "error")
Problem:
AtCoDeer the deer found two positive integers, a and b. Determine whether the product of a and b is even or odd.

Incorrect submission (verdict: Wrong Answer):
a, b = map(int, input().split())
if a * b % 2 == 0:
    print('even')
else:
    print('odd')

Fixed, accepted submission:
a, b = map(int, input().split())
if a * b % 2 == 0:
    print('Even')
else:
    print('Odd')
Problem:
We call a 4-digit integer with three or more consecutive same digits, such as 1118, **good**.  You are given a 4-digit integer N. Answer the question: Is N **good**?

Incorrect submission (verdict: Wrong Answer):
s = input()
prev_c = ""
count = 0
for c in s:
  if(c == prev_c):
    count += 1
  elif(count < 3):
    count = 0
  prev_c = c
print(count)

Fixed, accepted submission:
s = input()
if(s[0] == s[1]):
    if(s[1] == s[2]):
        print("Yes")
        exit()
if(s[1] == s[2]):
    if(s[2] == s[3]):
        print("Yes")
        exit()
print("No")
Problem:
You are given an integer N. Build an undirected graph with N vertices with indices 1 to N that satisfies the following two conditions:    * The graph is simple and connected.   * There exists an integer S such that, for every vertex, the sum of the indices of the vertices adjacent to that vertex is S.  It can be proved that at least one such graph exists under the constraints of this problem.

Incorrect submission (verdict: Wrong Answer):
n=int(input())
a=[]
for i in range(n-1):
    for j in range(i+1,n):
        a.append([i+1,j+1])
for i in a:
    if n%2==1:
        if sum(i)!=n:
            print(i[0],i[1])
    else:
        if sum(i)!=n+1:
            print(i[0],i[1])

Fixed, accepted submission:
n=int(input())
a=[]
for i in range(n-1):
    for j in range(i+1,n):
        a.append([i+1,j+1])
print((n*(n-1)//2)-n//2)
for i in a:
    if n%2==1:
        if sum(i)!=n:
            print(i[0],i[1])
    else:
        if sum(i)!=n+1:
            print(i[0],i[1])
Problem:
You are given two integer sequences of length N: a_1,a_2,..,a_N and b_1,b_2,..,b_N. Determine if we can repeat the following operation zero or more times so that the sequences a and b become equal.  Operation: Choose two integers i and j (possibly the same) between 1 and N (inclusive), then perform the following two actions **simultaneously** :    * Add 2 to a_i.   * Add 1 to b_j.

Incorrect submission (verdict: Wrong Answer):
if __name__ == '__main__':
    N = int(input())
    A = list(map(int, input().strip().split()))
    B = list(map(int, input().strip().split()))
    sousa_A, sousa_B = 0, 0
    if sum(A) > sum(B):
        print("No")
    elif all(a==b for a, b in zip(A, B)):
        print("Yes")
    for a, b in zip(A, B):
        if a > b:
            sousa_B += a-b
        if b > a:
            sousa_A += (b-a)//2
    if sousa_A == sousa_B:
        print("Yes")
    else:
        print("No")


Fixed, accepted submission:
n = int(input())
alist = list(map(int, input().split()))
blist = list(map(int, input().split()))

suma = sum(alist)
sumb = sum(blist)

ac, bc = 0, 0
for a, b in zip(alist, blist):
  if a < b:
    ac += (b - a) // 2 + (1 if (b - a) % 2 == 1 else 0)
  elif a > b:
    bc += a - b
if max(ac, bc) <= sumb - suma:
  print('Yes')
else:
  print('No')
Problem:
In AtCoder Kingdom, Gregorian calendar is used, and dates are written in the "year-month-day" order, or the "month-day" order without the year.   For example, May 3, 2018 is written as 2018-5-3, or 5-3 without the year.  In this country, a date is called _Takahashi_ when the month and the day are equal as numbers. For example, 5-5 is Takahashi.   How many days from 2018-1-1 through 2018-a-b are Takahashi?

Incorrect submission (verdict: Wrong Answer):

a, b = input().split()

a=2
b=5

if b < a:
	print(a-1)
else:
	print(a)



Fixed, accepted submission:
a, b = map(int, input().split())

if b < a:
	print(a-1)
else:
	print(a)
Problem:
Sitting in a station waiting room, Joisino is gazing at her train ticket.  The ticket is numbered with four digits A, B, C and D in this order, each between 0 and 9 (inclusive).  In the formula A op1 B op2 C op3 D = 7, replace each of the symbols op1, op2 and op3 with `+` or `-` so that the formula holds.  The given input guarantees that there is a solution. If there are multiple solutions, any of them will be accepted.

Incorrect submission (verdict: Wrong Answer):
a,b,c,d = list(input())

ls = ["+"] * 3

print(ls)

for i in range(2**3):
    ls = ["+"] * 3
    for j in range(len(ls)):
        
        if (i >> j) & 1:
            ls[j] = "-"

    if eval(a+ls[0]+b+ls[1]+c+ls[2]+d) == 7:
        print(a+ls[0]+b+ls[1]+c+ls[2]+d+"=7")
        break
        

Fixed, accepted submission:
a,b,c,d = list(input())

ls = ["+"] * 3


for i in range(2**3):
    ls = ["+"] * 3
    for j in range(len(ls)):
        
        if (i >> j) & 1:
            ls[j] = "-"

    if eval(a+ls[0]+b+ls[1]+c+ls[2]+d) == 7:
        print(a+ls[0]+b+ls[1]+c+ls[2]+d+"=7")
        break
Problem:
You are given nonnegative integers a and b (a ≤ b), and a positive integer x. Among the integers between a and b, inclusive, how many are divisible by x?

Incorrect submission (verdict: Wrong Answer):
a,b,x = map(int,input().split())
print((b-a+1)// x) 

Fixed, accepted submission:
a,b,x = map(int,input().split())
print((b+x)//x - (a-1+x)//x )
Problem:
Two students of AtCoder Kindergarten are fighting over candy packs.  There are three candy packs, each of which contains a, b, and c candies, respectively.  Teacher Evi is trying to distribute the packs between the two students so that each student gets the same number of candies. Determine whether it is possible.  Note that Evi cannot take candies out of the packs, and the whole contents of each pack must be given to one of the students.

Incorrect submission (verdict: Wrong Answer):
a,b,c=sorted(map(int,input().split()));print("YNEOS"[a+b!=c::2])

Fixed, accepted submission:
a,b,c=sorted(map(int,input().split()));print("YNeos"[a+b!=c::2])
Problem:
Given is an integer sequence D_1,...,D_N of N elements. Find the number, modulo 998244353, of trees with N vertices numbered 1 to N that satisfy the following condition:    * For every integer i from 1 to N, the distance between Vertex 1 and Vertex i is D_i.

Incorrect submission (verdict: Wrong Answer):
from collections import Counter

N = int(input())
D = list(map(int,input().split()))
C = Counter(D)
mod = 998244353
ans = 1
D_max = max(D)

if D[0] != 0 or C[0] != 1:
    print(0)
    exit()

def make_factorial_table(n):
    result = [0] * (n+1)
    result[0] = 1
    for i in range(1,n+1):
        result[i] = result[i-1] * i % mod
    return result

def nCr(n,r):
    return fact[n] * pow(fact[n-r],mod-2,mod) * pow(fact[r],mod-2,mod) % mod

fact = make_factorial_table(2*N)


for i in range(1,D_max+1):
    if C[i-1] == 1:
        ans *= C[i]
    else:
        ans *= nCr(C[i-1]-1+C[i],C[i-1]-1) % mod
    if ans == 0:
        break
print(ans)

Fixed, accepted submission:
from collections import Counter

N = int(input())
D = list(map(int,input().split()))
C = Counter(D)
mod = 998244353
ans = 1
D_max = max(D)

if D[0] != 0 or C[0] != 1:
    print(0)
    exit()


for i in D[1:]:
    ans *= C[i-1]
    ans %= mod
print(ans)
Problem:
Write a program which reads two integers a and b, and calculates the following values:    * a ÷ b: d (in integer)   * remainder of a ÷ b: r (in integer)   * a ÷ b: f (in real number)

Incorrect submission (verdict: Wrong Answer):
def main():
    a, b = map(int, input().split())
    print(a // b, a % b, a / b)

if __name__ == "__main__":
    main()

Fixed, accepted submission:
def main():
    a, b = map(int, input().split())
    print(a // b, a % b, "{:.5f}".format(a / b))

if __name__ == "__main__":
    main()
Problem:
You are given a grid with 2 rows and 3 columns of squares. The color of the square at the i-th row and j-th column is represented by the character C_{ij}.  Write a program that prints `YES` if this grid remains the same when rotated 180 degrees, and prints `NO` otherwise.

Incorrect submission (verdict: Wrong Answer):
first = input()
second = input()

if first[0] == second[2] and first[1] == second[1] and first[2] == second[0]:
    print('Yes')
else:
    print('No')

Fixed, accepted submission:
first = input()
second = input()

if first[0] == second[2] and first[1] == second[1] and first[2] == second[0]:
    print('YES')
else:
    print('NO')
Problem:
You are given a trapezoid. The lengths of its upper base, lower base, and height are a, b, and h, respectively.    An example of a trapezoid  Find the area of this trapezoid.

Incorrect submission (verdict: Wrong Answer):
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

A = int(input())
B = int(input())
H = int(input())

print((A + B) * H / 2)


Fixed, accepted submission:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

A = int(input())
B = int(input())
H = int(input())

print(int((A + B) * H / 2))
Problem:
There are N balls placed in a row. AtCoDeer the deer is painting each of these in one of the K colors of his paint cans. For aesthetic reasons, any two adjacent balls must be painted in different colors.  Find the number of the possible ways to paint the balls.

Incorrect submission (verdict: Wrong Answer):
N , K = map(int,input().split())
result = 1
for i in range(N):
    if i == 0:
        result = K
    else:
        result *= (K - 1)
        print(result)
print(result)


Fixed, accepted submission:
N , K = map(int,input().split())
result = 1
for i in range(N):
    if i == 0:
        result = K
    else:
        result *= (K - 1)
print(result)
Problem:
Snuke has N hats. The i-th hat has an integer a_i written on it.  There are N camels standing in a circle. Snuke will put one of his hats on each of these camels.  If there exists a way to distribute the hats to the camels such that the following condition is satisfied for every camel, print `Yes`; otherwise, print `No`.    * The bitwise XOR of the numbers written on the hats on both adjacent camels is equal to the number on the hat on itself.  What is XOR? The bitwise XOR x_1 \oplus x_2 \oplus \ldots \oplus x_n of n non- negative integers x_1, x_2, \ldots, x_n is defined as follows: - When x_1 \oplus x_2 \oplus \ldots \oplus x_n is written in base two, the digit in the 2^k's place (k \geq 0) is 1 if the number of integers among x_1, x_2, \ldots, x_n whose binary representations have 1 in the 2^k's place is odd, and 0 if that count is even. For example, 3 \oplus 5 = 6.

Incorrect submission (verdict: Wrong Answer):
N = int(input())
a = list(map(int, input().split()))
temp = 0

for i in range(N):
    temp = temp ^ a[i]

if temp^temp == temp:
    print('YES')
else:
    print('NO')

Fixed, accepted submission:
N = int(input())
a = list(map(int, input().split()))
temp = 0

for i in range(N):
    temp = temp ^ a[i]

if temp^temp == temp:
    print('Yes')
else:
    print('No')
Problem:
We will buy a product for N yen (the currency of Japan) at a shop.  If we use only 1000-yen bills to pay the price, how much change will we receive?  Assume we use the minimum number of bills required.

Incorrect submission (verdict: Wrong Answer):
import sys

def main():

	N = int(input())
	print(N%1000)

if __name__ == "__main__":
    main()

Fixed, accepted submission:
import sys

def main():

	N = int(input())
	m = N%1000
	if m == 0 :
		print(0)
	else:
		print(1000 - m)

if __name__ == "__main__":
    main()
Problem:
There are N people standing in a row from west to east. Each person is facing east or west. The directions of the people is given as a string S of length N. The i-th person from the west is facing east if S_i = `E`, and west if S_i = `W`.  You will appoint one of the N people as the leader, then command the rest of them to face in the direction of the leader. Here, we do not care which direction the leader is facing.  The people in the row hate to change their directions, so you would like to select the leader so that the number of people who have to change their directions is minimized. Find the minimum number of people who have to change their directions.

Incorrect submission (verdict: Wrong Answer):
N = int(input())
S = input()

cost = list(S).count("E")

ans = 10 ** 6
for si in S:
    if si == "E":
        cost -= 1
    
    if cost > ans:
        ans = cost

    if si == "W":
        cost += 1

print(ans)

Fixed, accepted submission:
N = int(input())
S = input()

cost = S.count("E")

ans = 1000000
for si in S:
    if si == "E":
        cost -= 1
    else:
        if cost < ans:
            ans = cost
        cost += 1
else:
    if cost < ans:
        ans = cost
print(ans)
Problem:
Iroha loves _Haiku_. Haiku is a short form of Japanese poetry. A Haiku consists of three phrases with 5, 7 and 5 syllables, in this order.  To create a Haiku, Iroha has come up with three different phrases. These phrases have A, B and C syllables, respectively. Determine whether she can construct a Haiku by using each of the phrases once, in some order.

Incorrect submission (verdict: Wrong Answer):
a,b,c =map(int,input().split() )
d = a + b + c
e = a * b * c
if(d == 17 and e == 175):
    print("Yes")
else:
    print("No")

Fixed, accepted submission:
a,b,c=map(int,input().split())
if(a+b+c==17 and a*b*c==25*7):
    print("YES")
else:
    print("NO")
Problem:
You are given three strings A, B and C. Check whether they form a _word chain_.  More formally, determine whether both of the following are true:    * The last character in A and the initial character in B are the same.   * The last character in B and the initial character in C are the same.  If both are true, print `YES`. Otherwise, print `NO`.

Incorrect submission (verdict: Wrong Answer):
A,B,C = map(str,input().split())

flag = True
if A[-1] != B[0]:
    flag = False

if B[-1] == C[0]:
    flag = False

if flag:
    print('YES')
else:
    print('NO')

Fixed, accepted submission:
A,B,C = map(str,input().split())

flag = True
if A[-1] != B[0]:
    flag = False

if B[-1] != C[0]:
    flag = False

if flag:
    print('YES')
else:
    print('NO')
Problem:
We have a tree with N vertices numbered 1 to N. The i-th edge in the tree connects Vertex u_i and Vertex v_i, and its length is w_i. Your objective is to paint each vertex in the tree white or black (it is fine to paint all vertices the same color) so that the following condition is satisfied:    * For any two vertices painted in the same color, the distance between them is an even number.  Find a coloring of the vertices that satisfies the condition and print it. It can be proved that at least one such coloring exists under the constraints of this problem.

Incorrect submission (verdict: Wrong Answer):
#21:30
n = int(input())
peer = [[] for _ in range(n)]
for _ in range(n-1):
  a,b,x = map(int,input().split())
  a -= 1
  b -= 1
  peer[a].append([b,x])
  peer[b].append([a,x])
ans = [-1 for _ in range(n)]
now = [0]
while now != []:
  last = now
  now = []
  for x in last:
    for yz in peer[x]:
      y = yz[0]
      z = yz[1]
      if ans[y] == -1:
        ans[y] = (ans[x] + z) % 2
        now.append(y)
  #print(now)
print(ans)

Fixed, accepted submission:
n = int(input())
peer = [[] for _ in range(n)]
for _ in range(n-1):
  u,v,w = map(int,input().split())
  u -= 1
  v -= 1
  w %= 2
  peer[u].append([v,w])
  peer[v].append([u,w])
now = [0]
clr = [-1 for _ in range(n)]
clr[0] = 0
while now:
  last = now
  now = []
  for x in last:
    for y in peer[x]:
      if clr[y[0]] == -1:
        now.append(y[0])
        clr[y[0]] = clr[x] ^ y[1]
for z in clr:
  print(z)
Problem:
You are given nonnegative integers a and b (a ≤ b), and a positive integer x. Among the integers between a and b, inclusive, how many are divisible by x?

Incorrect submission (verdict: Wrong Answer):
a,b,x=map(int,input().split())
print(b//x-a//x)

Fixed, accepted submission:
a,b,x=map(int,input().split())
if a%x>0 and b%x>0:
    print(b//x-a//x)
elif b%x==0 and a%x>0:
    print(b//x-a//x)
else:
    print(b//x-a//x+1)
Problem:
Determine if we can choose K different integers between 1 and N (inclusive) so that no two of them differ by 1.

Incorrect submission (verdict: Wrong Answer):
import sys
A,B = [int(n) for n in input().split()]
# N = int(input())
# A = [0]*N

#     A[i] = int(input())
# S = str(input())
# T = str(input())
if A/2 >= B:
    print("YES")
else:
    print("NO")

Fixed, accepted submission:
import sys
A,B = [int(n) for n in input().split()]
# N = int(input())
if((A+1)/2 >=B):
    print("YES")
    sys.exit()

print("NO")
Problem:
Sitting in a station waiting room, Joisino is gazing at her train ticket.  The ticket is numbered with four digits A, B, C and D in this order, each between 0 and 9 (inclusive).  In the formula A op1 B op2 C op3 D = 7, replace each of the symbols op1, op2 and op3 with `+` or `-` so that the formula holds.  The given input guarantees that there is a solution. If there are multiple solutions, any of them will be accepted.

Incorrect submission (verdict: Wrong Answer):
N = [int(i) for i in str(input())]
output = list()
num_op = 3

for i in range(2**num_op):
  ans = '{}'.format(str(N[0]))
  res = N[0]
  for j in range(num_op):
    if (i>>j) & 1:
      res += N[j+1]
      ans += '+{}'.format(str(N[j+1]))
    else:
      res -= N[j+1]
      ans += '-{}'.format(str(N[j+1]))
  if res == 7:
    output.append(ans+'=7')
    exit()
    

Fixed, accepted submission:
N = [int(i) for i in str(input())]
output = list()
num_op = 3

for i in range(2**num_op):
  ans = '{}'.format(str(N[0]))
  res = N[0]
  for j in range(num_op):
    if (i>>j) & 1:
      res += N[j+1]
      ans += '+{}'.format(str(N[j+1]))
    else:
      res -= N[j+1]
      ans += '-{}'.format(str(N[j+1]))
  if res == 7:
    print(ans+'=7')
    exit()
Problem:
You are given a string S of length 3 consisting of `a`, `b` and `c`. Determine if S can be obtained by permuting `abc`.

Incorrect submission (verdict: Wrong Answer):
a = "baa"
if a in ["abc","acb","bac","bca","cab","cba"]: #== ("abc" or "acb" or "bac" or "bca" or "cab" or "cba"):
  print("Yes")
else:
  print("No")

Fixed, accepted submission:
a = input()
if a in ["abc","acb","bac","bca","cab","cba"]: #== ("abc" or "acb" or "bac" or "bca" or "cab" or "cba"):
  print("Yes")
else:
  print("No")
Problem:
There is a kangaroo at coordinate 0 on an infinite number line that runs from left to right, at time 0. During the period between time i-1 and time i, the kangaroo can either stay at his position, or perform a jump of length exactly i to the left or to the right. That is, if his coordinate at time i-1 is x, he can be at coordinate x-i, x or x+i at time i. The kangaroo's nest is at coordinate X, and he wants to travel to coordinate X as fast as possible. Find the earliest possible time to reach coordinate X.

Incorrect submission (verdict: Wrong Answer):
import math
x = int(input())

n = -(-(-1 + math.sqrt(8*x+1)) // 2)
print(n)

Fixed, accepted submission:
import math
x = int(input())
 
n = -((1 - math.sqrt(8*x+1))//2)
print(int(n))
Problem:
Iroha loves _Haiku_. Haiku is a short form of Japanese poetry. A Haiku consists of three phrases with 5, 7 and 5 syllables, in this order.  To create a Haiku, Iroha has come up with three different phrases. These phrases have A, B and C syllables, respectively. Determine whether she can construct a Haiku by using each of the phrases once, in some order.

Incorrect submission (verdict: Wrong Answer):
A,B,C = list(map(int, input().split()))
if A*B*C == 15 :
    print('YES')
else:
    print('NO')
        

Fixed, accepted submission:
A,B,C = list(map(int, input().split()))
if A*B*C ==  175:
    print('YES')
else:
    print('NO')