TnT/CodeNet4Repair huggingface dataset:
Problem:
You are given a string s consisting of lowercase English letters. Extract all the characters in the odd-indexed positions and print the string obtained by concatenating them. Here, the leftmost character is assigned the index 1.

Incorrect submission (verdict: Wrong Answer):
s = input()
print(''.join([c for i, c in enumerate(s) if i % 2 == 1]))

Fixed, accepted submission:
s = input()
print(''.join([c for i, c in enumerate(s) if i % 2 == 0]))
Problem:
AtCoDeer the deer has found two positive integers, a and b. Determine whether the concatenation of a and b in this order is a square number.

Incorrect submission (verdict: Wrong Answer):
a,b=input().split();print('EOvdedn'[eval(a+'*'+b)%2!=0::2])

Fixed, accepted submission:
a,b=input().split();print('YNeos'[int(a+b)!=int(int(a+b)**.5)**2::2])
Problem:
Snuke has decided to construct a string that starts with `A` and ends with `Z`, by taking out a substring of a string s (that is, a consecutive part of s).  Find the greatest length of the string Snuke can construct. Here, the test set guarantees that there always exists a substring of s that starts with `A` and ends with `Z`.

Incorrect submission (verdict: Wrong Answer):
S = input()
SS = S[::-1]
ind_A = S.index('A')
ind_Z = SS.index('Z')
print(len(S[ind_A:ind_Z]))

Fixed, accepted submission:
s = input()

for ind, i in enumerate(s):
    if i == 'A':
        num1 = ind
        break

for ind, i in enumerate(s):
    if i == 'Z':
        num2 = ind

print(num2 - num1 + 1)
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%2==0 or b%2==0:
 print("Odd")
else:
 print("Even")

Fixed, accepted submission:
a , b =map(int,input().split())
if a%2==0 or b%2==0:
 print("Even")
else:
 print("Odd")
Problem:
Write a program which reads a rectangle and a circle, and determines whether the circle is arranged inside the rectangle. As shown in the following figures, the upper right coordinate $(W, H)$ of the rectangle and the central coordinate $(x, y)$ and radius $r$ of the circle are given.     

Incorrect submission (verdict: Wrong Answer):
# coding: utf-8
# Here your code !
import math

def func():
    try:
        line=input().rstrip()
        numbers=line.split(" ")
        
        width=float(numbers[0])
        height=float(numbers[1])
        x=float(numbers[2])
        y=float(numbers[3])
        r=abs(float(numbers[4]))
        
    except:
        print("input error")
        return -1
    
    wsign=math.copysign(1,width)
    hsign=math.copysign(1,height)
    
    result=(abs(x)+r <= wsign*width)
    result=result and (abs(x)-r >= 0)
    result=result and (abs(y)+r <= hsign*height)
    result=result and (abs(y)-r >= 0)
    
    if result:
        print("Yes")
    else:
        print("No")

Fixed, accepted submission:
# coding: utf-8
# Here your code !
import math

def func():
    try:
        line=input().rstrip()
        numbers=line.split(" ")
        
        width=float(numbers[0])
        height=float(numbers[1])
        x=float(numbers[2])
        y=float(numbers[3])
        r=abs(float(numbers[4]))
        
    except:
        print("input error")
        return -1
    
    wsign=math.copysign(1,width)
    hsign=math.copysign(1,height)
    
    
    result="No"
    if(wsign*x+r <= wsign*width):
        if(wsign*x-r >= 0):
            if(hsign*y+r <= hsign*height):
                if(hsign*y-r >= 0):
                    result="Yes"
  
    print(result)
    
func()
Problem:
Snuke has come to a store that sells boxes containing balls. The store sells the following three kinds of boxes:    * Red boxes, each containing R red balls   * Green boxes, each containing G green balls   * Blue boxes, each containing B blue balls  Snuke wants to get a total of exactly N balls by buying r red boxes, g green boxes and b blue boxes. How many triples of non-negative integers (r,g,b) achieve this?

Incorrect submission (verdict: Time Limit Exceeded):
r,g,b,n = map(int,input().split())
c = 0
for i in range(3001):
  for j in range(3001):
    for k in range(3001):
      if i*r + j*g + k*b == n:
        c += 1
print(c)

Fixed, accepted submission:
r,g,b,n = map(int,input().split())
c = 0
for i in range(n//r+1):
  for j in range((n-i*r)//g+1):
    k = (n-i*r-j*g)
    if k%b == 0 and k >= 0:
      c += 1
print(c)
Problem:
Takahashi wants to gain muscle, and decides to work out at AtCoder Gym.  The exercise machine at the gym has N buttons, and exactly one of the buttons is lighten up. These buttons are numbered 1 through N. When Button i is lighten up and you press it, the light is turned off, and then Button a_i will be lighten up. It is possible that i=a_i. When Button i is not lighten up, nothing will happen by pressing it.  Initially, Button 1 is lighten up. Takahashi wants to quit pressing buttons when Button 2 is lighten up.  Determine whether this is possible. If the answer is positive, find the minimum number of times he needs to press buttons.

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

a_n=list(map(int,input().split()))

if 2 not in a_n:
    print(-1)
else:
    for i in range(N):
        if a_n[i]==2:
            print(i+1)
            break

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

a_n=[int(input()) for i in range(N)]
import sys

i=1
count=0
for k in range(N):
    if a_n[i-1]==2:
        count+=1
        print(count)
        sys.exit()
    else:
        i=a_n[i-1]
        count+=1

print(-1)
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):
n=int(input())
print(n%1000)

Fixed, accepted submission:
n=int(input())
if n%1000 ==0:
 print(n%1000)
else:  
 print(1000-n%1000)
Problem:
Joisino is about to compete in the final round of a certain programming competition. In this contest, there are N problems, numbered 1 through N. Joisino knows that it takes her T_i seconds to solve problem i(1≦i≦N).  Also, there are M kinds of drinks offered to the contestants, numbered 1 through M. If Joisino takes drink i(1≦i≦M), her brain will be stimulated and the time it takes for her to solve problem P_i will become X_i seconds. It does not affect the time to solve the other problems.  A contestant is allowed to take exactly one of the drinks before the start of the contest. For each drink, Joisino wants to know how many seconds it takes her to solve all the problems if she takes that drink. Here, assume that the time it takes her to solve all the problems is equal to the sum of the time it takes for her to solve individual problems. Your task is to write a program to calculate it instead of her.

Incorrect submission (verdict: Wrong Answer):
x=int(input())
a=list(map(int,input().split()))
d=int(input())
n=0
A=a
j=[list(map(int,input().split())) for i in range(d)]
for T in range(d):
    s=j[n][0]
    A[s-1]=j[n][1]
    print(sum(A))
    n+=1
    A[s-1]=a[s-1]

Fixed, accepted submission:
x=int(input())
first=list(map(int,input().split()))
drink_count=int(input())
count=0
Total=sum(first)
drink=[list(map(int,input().split())) for i in range(drink_count)]
for T in range(drink_count):
    change_num = drink[count][0]
    score = first[change_num-1]-drink[count][1]
    print(Total-score)
    count+=1
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=input().split()
print(a,b,c)

Fixed, accepted submission:
a,b,c=input().split()
if a=="5" and b=="5" and c=="7":
	print("YES")
elif a=="5" and b=="7" and c=="5":
	print("YES")
elif a=="7" and b=="5" and c=="5":
	print("YES")
else:
  print("NO")
Problem:
The word `internationalization` is sometimes abbreviated to `i18n`. This comes from the fact that there are 18 letters between the first `i` and the last `n`.  You are given a string s of length at least 3 consisting of lowercase English letters. Abbreviate s in the same way.

Incorrect submission (verdict: Wrong Answer):
a = list(input())
num = len(a)
print(a[0]+str(num)+a[-1])


Fixed, accepted submission:
a = list(input())
print(a[0]+str(len(a)-2)+a[-1])
Problem:
We have a board with H horizontal rows and W vertical columns of squares. There is a bishop at the top-left square on this board. How many squares can this bishop reach by zero or more movements?  Here the bishop can only move diagonally. More formally, the bishop can move from the square at the r_1-th row (from the top) and the c_1-th column (from the left) to the square at the r_2-th row and the c_2-th column if and only if exactly one of the following holds:    * r_1 + c_1 = r_2 + c_2   * r_1 - c_1 = r_2 - c_2  For example, in the following figure, the bishop can move to any of the red squares in one move:  

Incorrect submission (verdict: Wrong Answer):
H, W = list(map(int, input().split()))
res = int((H+1)/2) * W
if W%2==1:
    res -= int(W/2)
print(res)

Fixed, accepted submission:
H, W = list(map(int, input().split()))
if H==1 or W==1:
    print(1)
    exit()
res = int((H+1)/2) * W
if H%2==1:
    res -= int(W/2)
print(res)
Problem:
Snuke has a favorite restaurant.  The price of any meal served at the restaurant is 800 yen (the currency of Japan), and each time a customer orders 15 meals, the restaurant pays 200 yen back to the customer.  So far, Snuke has ordered N meals at the restaurant. Let the amount of money Snuke has paid to the restaurant be x yen, and let the amount of money the restaurant has paid back to Snuke be y yen. Find x-y.

Incorrect submission (verdict: Wrong Answer):
n=int(input())
x=500*n
y=n//15*200
print(x-y)

Fixed, accepted submission:
n=int(input())
x=800*n
y=n//15*200
print(x-y)
Problem:
Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters.  Snuke has decided to abbreviate the name of the contest as "AxC". Here, x is the uppercase English letter at the beginning of s.  Given the name of the contest, print the abbreviation of the name.

Incorrect submission (verdict: Wrong Answer):
con = input().split()
cap = con[2][0]
name = "A" + cap + "C"
print(name)

Fixed, accepted submission:
con = input().split()
cap = con[1][0]
name = "A" + cap + "C"
print(name)
Problem:
You are given two positive integers a and b. Let x be the average of a and b. Print x rounded up to the nearest integer.

Incorrect submission (verdict: Wrong Answer):
a,b=map(int,input().split())
x=(a+b)/2
if x*10%10==5:
    print(x*10//10+1)
else:
    print(x)
    


Fixed, accepted submission:
a,b=map(int,input().split())
x=(a+b)/2
if x*10%10==5:
    print(int(x*10//10+1))
else:
    print(int(x))
Problem:
You are given a string s consisting of lowercase English letters. Extract all the characters in the odd-indexed positions and print the string obtained by concatenating them. Here, the leftmost character is assigned the index 1.

Incorrect submission (verdict: Wrong Answer):
s = input()
counter = 0
res = []
for i in s:
  counter += 1
  if counter % 2 != 0:
    res.append(i)
print("res:","".join(res))


Fixed, accepted submission:
s = input()
counter = 0
res = []
for i in s:
  counter += 1
  if counter % 2 != 0:
    res.append(i)
print("".join(res))
Problem:
Mammy decided to give Taro his first shopping experience. Mammy tells him to choose any two items he wants from those listed in the shopping catalogue, but Taro cannot decide which two, as all the items look attractive. Thus he plans to buy the pair of two items with the highest price sum, not exceeding the amount Mammy allows. As getting two of the same item is boring, he wants two different items.  You are asked to help Taro select the two items. The price list for all of the items is given. Among pairs of two items in the list, find the pair with the highest price sum not exceeding the allowed amount, and report the sum. Taro is buying two items, not one, nor three, nor more. Note that, two or more items in the list may be priced equally.

Incorrect submission (verdict: Wrong Answer):
n=5
m=5
sum=0
A=[]

while n!=0:
    n,m=[int(i) for i in input().split()]
    if n==0 and m==0:
        break
    val=[int(i) for i in input().split()]
    m1=m2=val[0]
    for i in range(1,n):
        if val[i]>=m1:
             m1=val[i]
        elif val[i]>m2:
             m2=val[i];
    sum=m1+m2
    if sum>m:
        sum=0
    A.append(sum)

for i in range(len(A)):
    print(A[i])


Fixed, accepted submission:
n=5
m=5
z=0
sum=0
A=[]

while n!=0:
    n,m=[int(i) for i in input().split()]
    if n==0 and m==0:
        break
    val=[int(i) for i in input().split()]
    ans1=0
    mm=0
    for i in range(0,n):
        for j in range(i+1,n):
            if i==j:
                break
            ans1=val[i]+val[j]
            if ans1>mm and ans1<=m:
                mm=ans1
        ans1=0
    A.append(mm)
    z=z+1

for i in range(z):
    if A[i]==0:
        A[i]="NONE"
    print(A[i])
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):
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
k = 0
for i in a:
    if i % 2 == 0:
        k += 1
for j in b:
    if j % 2 == 1:
        k -= 1

if k == 0:
    print("YES")
else:
    print("NO")


Fixed, accepted submission:
N = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
p, q = 0, 0
for i in range(N):
    if a[i] > b[i]:
        p += a[i] - b[i]
    elif a[i] < b[i]:
        q += (b[i] - a[i]) // 2

if p <= q:
    print('Yes')
else:
    print('No')
Problem:
Write a program which reads a rectangle and a circle, and determines whether the circle is arranged inside the rectangle. As shown in the following figures, the upper right coordinate $(W, H)$ of the rectangle and the central coordinate $(x, y)$ and radius $r$ of the circle are given.     

Incorrect submission (verdict: Wrong Answer):
value = input().split()
W = int(value[0])
H = int(value[1])
coordinate = [[0 for _ in range(W)] for _ in range(H)]
x = int(value[2])
y = int(value[3])
r =int(value[4])
try:
    tmp = coordinate[y][x + r]
    tmp = coordinate[y][x - r]
    tmp = coordinate[y + r][x]
    tmp = coordinate[y - r][x]
    print("YES")
except Exception:
    print("NO")



Fixed, accepted submission:
value = input().split()
W = int(value[0])
H = int(value[1])
coordinate = [[0 for _ in range(W + 1)] for _ in range(H + 1)]
x = int(value[2])
y = int(value[3])
r =int(value[4])
try:
    if x < 0 or y < 0:
        print("No")
    else:     
            tmp = coordinate[y][x + r]
            tmp = coordinate[y][x - r]
            tmp = coordinate[y + r][x]
            tmp = coordinate[y - r][x]
            print("Yes")
except Exception:
    print("No")
Problem:
Write a program of a Merge Sort algorithm implemented by the following pseudocode. You should also report the number of comparisons in the Merge function.                 Merge(A, left, mid, right)   n1 = mid - left;   n2 = right - mid;   create array L[0...n1], R[0...n2]   for i = 0 to n1-1     do L[i] = A[left + i]   for i = 0 to n2-1     do R[i] = A[mid + i]   L[n1] = SENTINEL   R[n2] = SENTINEL   i = 0;   j = 0;   for k = left to right-1     if L[i] <= R[j]       then A[k] = L[i]            i = i + 1       else A[k] = R[j]            j = j + 1  Merge-Sort(A, left, right){   if left+1 < right     then mid = (left + right)/2;          call Merge-Sort(A, left, mid)          call Merge-Sort(A, mid, right)          call Merge(A, left, mid, right)

Incorrect submission (verdict: Wrong Answer):
def merge(A, left, mid, right):
  cnt = 0
  n1 = mid - left
  n2 = right - mid
  L, R = [0]*(n1+1), [0]*(n2+1)
  for i in range(n1):
    L[i] = A[left + i]
  for i in range(n2):
    R[i] = A[mid + i]
  L[n1] = float("inf")
  R[n2] = float("inf")
  i = 0
  j = 0
  for k in range(left, right):
    cnt = cnt + 1
    if L[i] <= R[j]:
      A[k] = L[i]
      i = i + 1
    else:
      A[k] = R[j]
      j = j + 1
  return cnt

def mergeSort(A, left, right, cnt):
  if left+1 < right:
    mid = int((left + right)/2)
    mergeSort(A, left, mid, cnt)
    mergeSort(A, mid, right, cnt)
    cnt[0] = cnt[0] + merge(A, left, mid, right)

if __name__ == "__main__":
  n = int(input())
  S = list(map(int, input().split()))
  cnt = [0]
  mergeSort(S, 0, len(S), cnt)
  print(S)
  print(cnt[0])

Fixed, accepted submission:
count = 0

def merge(A, left, mid, right):
  global count
  n1 = mid - left
  n2 = right - mid
  L = A[left:left+n1]
  R = A[mid:mid+n2]
  L.append(float("inf"))
  R.append(float("inf"))
  i = 0
  j = 0
  for k in range(left, right):
    count += 1
    if L[i] <= R[j]:
      A[k] = L[i]
      i += 1
    else:
      A[k] = R[j]
      j += 1

def mergeSort(A, left, right):
  if left + 1 < right:
    mid = int((left + right)/2)
    mergeSort(A, left, mid)
    mergeSort(A, mid, right)
    merge(A, left, mid, right)

if __name__ == "__main__":
  n = int(input())
  S = list(map(int, input().split()))
  mergeSort(S, 0, len(S))
  print(" ".join(map(str, S)))
  print(count)
Problem:
Write a program which calculates the cube of a given integer x.

Incorrect submission (verdict: Wrong Answer):
def f(x):
 if 1 <= x <= 100:
  print("error")
 return x**3


Fixed, accepted submission:
x = int(input())
print(x**3)
Problem:
Write a program which computes the digit number of sum of two integers a and b.

Incorrect submission (verdict: Wrong Answer):
import math
a, b = map(int, input().split())
ans = a + b
print(int(math.log10(ans)) + 1)


Fixed, accepted submission:
while True:
	try:
		a, b = map(int, input().split())
		print(len(str(a+b)))
	except:
		break
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 = input().split(" ")

a= int(a)
b= int(b)

c = a*b

if c%2 ==0:
    print("even")
    
else:
    print("odd")

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

a = int(a)
b = int(b)


if a*b % 2 == 0:
    
    print("Even")

else:
    print("Odd")
Problem:
Three poles stand evenly spaced along a line. Their heights are a, b and c meters, from left to right. We will call the arrangement of the poles _beautiful_ if the tops of the poles lie on the same line, that is, b-a = c-b.  Determine whether the arrangement of the poles is beautiful.

Incorrect submission (verdict: Wrong Answer):
a,b,c=map(int,input().split())
print("YES" if a==b==c else "NO")

Fixed, accepted submission:
a,b,c=map(int,input().split())
print("YES" if b-a==c-b else "NO")
Problem:
You manage 4 buildings, each of which has 3 floors, each of which consists of 10 rooms. Write a program which reads a sequence of tenant/leaver notices, and reports the number of tenants for each room.  For each notice, you are given four integers b, f, r and v which represent that v persons entered to room r of fth floor at building b. If v is negative, it means that −v persons left.  Assume that initially no person lives in the building.

Incorrect submission (verdict: Wrong Answer):
# coding: utf-8
# Here your code !

num_j = [[[0 for _ in range(10)] for _ in range(3)] for _ in range(4)]

n = int(input())

for _ in range(n):
    b,r,f,v = map(int,input().split())
    num_j[b-1][r-1][f-1] += v

for i in range(4):
    for j in range(3):
        print(" ",end="")       
        print(" ".join(map(str,num_j[i][j])))
    print("#"*20)

Fixed, accepted submission:
# coding: utf-8
# Here your code !

num_j = [[[0 for _ in range(10)] for _ in range(3)] for _ in range(4)]

n = int(input())

for _ in range(n):
    b,r,f,v = [int(x) for x in input().split()]
    num_j[b-1][r-1][f-1] += v

for i in range(4):
    for f in num_j[i]:
        print(""," ".join([str(x) for x in f]))
    
    if i != 3:
        print("#"*20)
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 = sorted(map(int,input().split()))
if a == 5 and b == 7 and c == 5:
    print("YES")
else:
    print("NO")

Fixed, accepted submission:
go = list(map(int,input().split()))
if go.count(5) == 2 and go.count(7) == 1:
    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):
class UnionFind(object):
    def __init__(self, n=1):
        self.par = [i for i in range(n)]
        self.rank = [0 for _ in range(n)]

    def find(self, x):
        if self.par[x] == x:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x != y:
            if self.rank[x] < self.rank[y]:
                x, y = y, x
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1
            self.par[y] = x

    def is_same(self, x, y):
        return self.find(x) == self.find(y)

def solve():
  n = int(input())
  
  uf = UnionFind(n)
  ans = [0]*n
  tmp = []
  for i in range(n-1):
    x,y,z = (int(i) for i in input().split())
    if z%2 == 1:
      tmp.append((x,y,z))
    else:
     uf.union(x-1,y-1)
     ans[x-1] = 1
     ans[y-1] = 1
  while tmp:
    x,y,z = tmp.pop(0)
    
  
  for i in ans:
    print(i)
     
     
  
solve()


Fixed, accepted submission:
import sys
input = sys.stdin.readline
from collections import deque
def solve():
  n = int(input())
  treenode = [[] for _ in range(n)]
  treecolor = [-2]*n
  for i in range(n-1):
    u,v,w = (int(i) for i in input().split())
    u -= 1
    v -= 1
    treenode[u].append((v,w%2))
    treenode[v].append((u,w%2))
  query = deque([(0,0,0)])
  while query:
    a,b,c = query.popleft()
    if b%2 == 0:
      treecolor[a] = c
      nextc = c
    else:
      treecolor[a] = 1^c
      nextc = 1^c
    for nextnode,weight in treenode[a]:
      if treecolor[nextnode] != -2:
        continue
      else:
        query.append((nextnode,weight,nextc))  
        treecolor[nextnode] = -1
  for i in treecolor:
    print(i)
solve()
Problem:
In this problem, a date is written as Y-M-D. For example, 2019-11-30 means November 30, 2019.  Integers M_1, D_1, M_2, and D_2 will be given as input.   It is known that the date 2019-M_2-D_2 follows 2019-M_1-D_1.   Determine whether the date 2019-M_1-D_1 is the last day of a month.

Incorrect submission (verdict: Wrong Answer):
M_1, D_1 = map(int, input().split())
M_2, D_2 = map(int, input().split())

if M_1 != M_2:
  print('No')
else:
  print('Yes')

Fixed, accepted submission:
M_1, D_1 = map(int, input().split())
M_2, D_2 = map(int, input().split())

if M_1 != M_2:
  print(1)
else:
  print(0)