Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
s=list(input())
 
if( s[0] == s[1] and s[1] == s[2] and s[2] == s[3] ):
  print('No')
else if(( s[0]==s[1] and s[2]==s[3] )or( s[0]==s[2] and s[1]==s[3] )or( s[0]==s[3] and s[1]==s[2] )):
    print('Yes')
else:
    print('No')

Fixed submission:
s=list(input())
 
if( s[0] == s[1] and s[1] == s[2] and s[2] == s[3] ):
  print('No')
elif(( s[0]==s[1] and s[2]==s[3] )or( s[0]==s[2] and s[1]==s[3] )or( s[0]==s[3] and s[1]==s[2] )):
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Time Limit Exceeded):
import sys
import bisect
input = sys.stdin.readline

def main():
    n=int(input())
    d = list(map(int,input().split()))
    cnt=0

    d.sort()
    a=d[0]
    b=d[n-1]
    c=b-a+1

    for i in range(c):
        index=bisect.bisect_right(d,i+a)
        D=d[index:]
        lend=len(D)
        if(int(n//2)==lend):
            cnt+=1
    
    print(cnt)
    
main()


Fixed submission:
import sys
import bisect
input = sys.stdin.readline

def main():
    n=int(input())
    d = list(map(int,input().split()))
    cnt=0

    d.sort()
    a=d[(n//2)-1]
    b=d[(n//2)]
    ans=b-a
    print(ans)
    
main()

Buggy python submission (verdict: Time Limit Exceeded):
import sys
import bisect
input = sys.stdin.readline

n=int(input())
d = list(map(int,input().split()))
cnt=0

d.sort()
a=d[0]
b=d[n-1]
c=b-a+1

for i in range(c):
    index=bisect.bisect_right(d,i+a)
    D=d[index:]
    lend=len(D)
    if(int(n//2)==lend):
        cnt+=1
    

print(cnt)


Fixed submission:
import sys
import bisect
input = sys.stdin.readline

def main():
    n=int(input())
    d = list(map(int,input().split()))
    cnt=0

    d.sort()
    a=d[(n//2)-1]
    b=d[(n//2)]
    ans=b-a
    print(ans)
    
main()
Buggy python submission (verdict: Runtime Error):
def main():
    n,a,b,c,d = map(int,input().split()) 
    s=list(input())
    for i in range(max(c,d)-a-1):
        if s[a+i-1]=="#" and s[a+i]=="#":
            print("No")
            return
    if c<d:
        print("Yes")
        return
    else:
        for i in range(c-b+1):
            if s[b+i-2]==s[b+i-1] and s[b+i-1] == s[b+i] and s[b+i]==".":
                print("Yes")
                return
        print("No")
main()

Fixed submission:
def main():
    n,a,b,c,d = map(int,input().split()) 
    s=list(input())
    for i in range(max(c,d)-a-1):
        if s[a+i-1]=="#" and s[a+i]=="#":
            print("No")
            return
    if c<d:
        print("Yes")
        return
    else:
        for i in range(d-b+1):
            if s[b+i-2]==s[b+i-1] and s[b+i-1] == s[b+i] and s[b+i]==".":
                print("Yes")
                return
        print("No")
main()

Buggy python submission (verdict: Runtime Error):
def main():
    n,a,b,c,d = map(int,input().split()) 
    s=list(input())
    for i in range(max(c,d)-a-1):
        if s[a+i-1]=="#" and s[a+i]=="#":
            print("No")
            return
    if c<d:
        print("Yes")
        return
    else:
        for i in range(c-b-2):
            if s[b+i]==s[b+i+1] and s[b+i]==".":
                print("Yes")
                return
        if s[b]=="." and s[b-2]==".":
            print("Yes")
            return
        if s[d]=="." and s[d+2]==".":
            print("Yes")
            return
        print("No")
main()

Fixed submission:
def main():
    n,a,b,c,d = map(int,input().split()) 
    s=list(input())
    for i in range(max(c,d)-a-1):
        if s[a+i-1]=="#" and s[a+i]=="#":
            print("No")
            return
    if c<d:
        print("Yes")
        return
    else:
        for i in range(d-b+1):
            if s[b+i-2]==s[b+i-1] and s[b+i-1] == s[b+i] and s[b+i]==".":
                print("Yes")
                return
        print("No")
main()

Buggy python submission (verdict: Runtime Error):
def main():
    n,a,b,c,d = map(int,input().split()) 
    s=list(input())
    for i in range(max(c,d)-a-1):
        if s[a+i-1]=="#" and s[a+i]=="#":
            print("No")
            return
    if c<d:
        print("Yes")
        return
    else:
        for i in range(c-b-2):
            if s[b+i]==s[b+i+1] and s[b+i]==".":
                print("Yes")
                return
        if s[b]=="." and s[b-2]==".":
            print("Yes")
            return
        if s[c]=="." and s[c+2]==".":
            print("Yes")
            return
        print("No")
main()

Fixed submission:
def main():
    n,a,b,c,d = map(int,input().split()) 
    s=list(input())
    for i in range(max(c,d)-a-1):
        if s[a+i-1]=="#" and s[a+i]=="#":
            print("No")
            return
    if c<d:
        print("Yes")
        return
    else:
        for i in range(d-b+1):
            if s[b+i-2]==s[b+i-1] and s[b+i-1] == s[b+i] and s[b+i]==".":
                print("Yes")
                return
        print("No")
main()
Buggy python submission (verdict: Runtime Error):
from collections import Counter,defaultdict,deque
import sys
from itertools import permutations, combinations
from heapq import heappop, heappush
# input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
    
def inp(): # n=1
    return int(input())
def inpm(): # x=1,y=2
    return map(int,input().split())
def inpl(): # a=[1,2,3,4,5,...,n]
    return list(map(int, input().split()))
def inpls(): # a=['1','2','3',...,'n']
    return list(input().split())
def inplm(n): # x=[] 複数行
    return list(int(input()) for _ in range(n))
def inpll(n): # [[1,1,1,1],[2,2,2,2],[3,3,3,3]]
    return sorted([list(map(int, input().split())) for _ in range(n)])

def main():
    n,k = inpm()
    v = inpl()
    a = [0 for _ in range(n+1)]
    b = [0 for _ in range(n+1)]
    ans = 0
    for i in range(n):
        a[i+1] = a[i] + v[i]
        b[i+1] = b[i] + v[n-1-i]
    for x in range(k+1):
        for y in range(k-x+1):
            que = []
            for i in range(x):
                que.append(v[i])
            for i in range(y):
                que.append(v[n-1-i])
            que.sort()
            l = len(que)
            pre = a[x] + b[y]
            for z in range(min(l,k-x-y)):
                if que[z]>=0:
                    break
                pre -= que[z]
                ans = max(ans,pre)
    print(ans)

if __name__ == "__main__":
    main()

Fixed submission:
from collections import Counter,defaultdict,deque
import sys
from itertools import permutations, combinations
from heapq import heappop, heappush
# input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
    
def inp(): # n=1
    return int(input())
def inpm(): # x=1,y=2
    return map(int,input().split())
def inpl(): # a=[1,2,3,4,5,...,n]
    return list(map(int, input().split()))
def inpls(): # a=['1','2','3',...,'n']
    return list(input().split())
def inplm(n): # x=[] 複数行
    return list(int(input()) for _ in range(n))
def inpll(n): # [[1,1,1,1],[2,2,2,2],[3,3,3,3]]
    return sorted([list(map(int, input().split())) for _ in range(n)])

def main():
    n,k = inpm()
    v = inpl()
    a = [0 for _ in range(n+1)]
    b = [0 for _ in range(n+1)]
    ans = 0
    for i in range(n):
        a[i+1] = a[i] + v[i]
        b[i+1] = b[i] + v[n-1-i]
    for x in range(min(n+1,k+1)):
        for y in range(min(n-x+1,k-x+1)):
            que = []
            for i in range(x):
                que.append(v[i])
            for i in range(y):
                que.append(v[n-1-i])
            que.sort()
            l = len(que)
            pre = a[x] + b[y]
            for z in range(min(l,k-x-y)):
                if que[z]>=0:
                    break
                pre -= que[z]
                ans = max(ans,pre)
            ans = max(ans,pre)
    print(ans)

if __name__ == "__main__":
    main()
Buggy python submission (verdict: Time Limit Exceeded):
r,g,b,n = map(int,input().split())
cnt=0
s=[r,g,b]
s.sort()
for i in range(n//s[2]+1):
    if i*s[2]==n:
        cnt+=1
    else:
        for j in range((n-i*s[2])//s[1]+1):
            if n-i*s[2]==s[1]*j:
                cnt+=1
            else:
                if (n-i*s[2]-j*s[1]) % s[0] ==0:
                    cnt+=1
print(cnt)



Fixed submission:
r,g,b,n = map(int,input().split())
cnt=0
s=[r,g,b]
s.sort()
for i in range(n//s[2]+1):
    if i*s[2]==n:
        cnt+=1
    else:
        for j in range((n-i*s[2])//s[1]+1):
            if n-i*s[2]==s[1]*j:
                cnt+=1
            else:
                if (n-i*s[2]-j*s[1]) % s[0] ==0:
                    cnt+=1
print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n = int(input())
    v = list(map(int,input().split()))
    o=[]
    e=[]
    checked=[]
    for i in v:
        if not i in checked:
            checked.append(i)
            c0=c1=0
            for j in range(n//2):
                if v[2*j]==i:
                    c0+=1
                if v[2*j+1]==i:
                    c1+=1
            if n%2==1:
                if v[n-1]==i:
                    c1+=1
            o.append([c0,i])
            e.append([c1,i])
    o.append([0,10**6])
    e.append([0,10**6])
    o.sort(reverse=True)
    e.sort(reverse=True)
    if o[0][1]!=e[0][1]:
        print(n-o[0][0]-e[0][0])
        return
    else:
        print(min(n-o[1][0]-e[0][0],n-o[0][0]-e[1][0]))
        return
if __name__ == "__main__":
    main()

Fixed submission:
def main():
    n = int(input())
    v = list(map(int,input().split()))
    odd={}
    even={}
    for i in range(n):
        if i%2==0:
            if v[i] not in odd:
                odd[v[i]]=1
            else:
                odd[v[i]]+=1
        else:
            if v[i] not in even:
                even[v[i]]=1
            else:
                even[v[i]]+=1
    cnt_o=[]
    cnt_e=[]
    for i in odd:
        cnt_o.append([odd[i],i])
    for i in even:
        cnt_e.append([even[i],i])
    cnt_o.append([0,10**6])
    cnt_e.append([0,10**6])
    cnt_o.sort(reverse=True)
    cnt_e.sort(reverse=True)
    if cnt_o[0][1]!=cnt_e[0][1]:
        print(n-cnt_o[0][0]-cnt_e[0][0])
        return
    else:
        print(min(n-cnt_o[1][0]-cnt_e[0][0],n-cnt_o[0][0]-cnt_e[1][0]))
        return
if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

def gcd_list(numbers):
    return reduce(math.gcd, numbers)
    
n,x = map(int,input().split())
s = list(map(int,input().split()))

for i in range(n):
    s[i]-=x

ans=gcd_list(s)
   
print(ans)

Fixed submission:
def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a%b)

n,x = map(int,input().split())
s = list(map(int,input().split()))

for i in range(n):
    s[i]-=x
ans=s[0]
for i in range(n-1):
    ans=gcd(ans,s[i+1])

if(ans<0):
    ans=-ans
    

print(ans)
Buggy python submission (verdict: Runtime Error):
v

Fixed submission:
n=int(input())
a = list(map(int,input().split()))
cnt=0
for i in range(n):
    while a[i]%2==0:
        a[i]=a[i]//2
        cnt+=1
print(cnt)
Buggy python submission (verdict: Runtime Error):
import sys
import numpy as np
input = sys.stdin.readline
def main():
    n,m = map(int,input().split())
    xyz = [[] for _ in range(8)]
    pm = [[ 1, 1, 1],
          [ 1, 1,-1],
          [ 1,-1, 1],
          [-1, 1, 1],
          [ 1,-1,-1],
          [-1, 1,-1],
          [-1,-1, 1],
          [-1,-1,-1]]
    pm = np.array(pm)
    for _ in range(n):
        x,y,z = map(int,input().split())
        for i in range(8):
            k = np.array([x,y,z])
            xyz[i].append(sum(pm[i]*k))
    ans = -10**20
    for i in range(8):
        X = xyz[i]
        X.sort(reverse=True)
        cnt = 0
        for j in range(m):
            cnt += X[j]
        ans = max(ans,cnt)
    print(ans)

if __name__ == "__main__":
    main()

Fixed submission:
import sys
import numpy as np
input = sys.stdin.readline
def main():
    n,m = map(int,input().split())
    xyz = [[] for _ in range(8)]
    pm = [[ 1, 1, 1],
          [ 1, 1,-1],
          [ 1,-1, 1],
          [-1, 1, 1],
          [ 1,-1,-1],
          [-1, 1,-1],
          [-1,-1, 1],
          [-1,-1,-1]]
    pm = np.array(pm)
    for _ in range(n):
        x,y,z = map(int,input().split())
        for i in range(8):
            k = np.array([x,y,z])
            xyz[i].append(sum(pm[i]*k))
    ans = -10**20
    for i in range(8):
        X = xyz[i]
        X.sort(reverse=True)
        cnt = 0
        for j in range(m):
            cnt += X[j]
        ans = max(ans,cnt)
    print(ans)

if __name__ == "__main__":
    main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    s=input()
    m=int(input())
    tank=[]
    n=len(s)
    alpha=[chr(i) for i in range(97, 97+26)]
    for i in range(26):
        for j in range(n):
            if alpha[i]==s[j]:
                for k in range(n-j):
                    if s[j:j+k+1] not in tank:
                        tank.append(s[j:j+k+1])
        if len(tank)>=m:
            break
    tank.sort()
    print(tank[m-1])
    
if __name__ == "__main__":
    main()


Fixed submission:
def main():
    s=input()
    m=int(input())
    tank=[]
    n=len(s)
    alpha=[chr(i) for i in range(97, 97+26)]
    for i in range(26):
        for j in range(n):
            if alpha[i]==s[j]:
                for k in range(min(n-j,m)):
                    if s[j:j+k+1] not in tank:
                        tank.append(s[j:j+k+1])
        if len(tank)>=m:
            break
    tank.sort()
    print(tank[m-1])
    
if __name__ == "__main__":
    main()

Buggy python submission (verdict: Runtime Error):
def main():
    s=input()
    m=int(input())
    tank=[]
    n=len(s)
    alpha=[chr(i) for i in range(97, 97+26)]
    for i in range(26):
        for j in range(n):
            if alpha[i]==s[j]:
                for k in range(n-j):
                    if s[j:j+k+1] not in tank:
                        tank.append(s[j:j+k+1])
        if len(tank)>=k:
            break
    tank.sort()
    print(tank[m-1])
    
if __name__ == "__main__":
    main()


Fixed submission:
def main():
    s=input()
    m=int(input())
    tank=[]
    n=len(s)
    alpha=[chr(i) for i in range(97, 97+26)]
    for i in range(26):
        for j in range(n):
            if alpha[i]==s[j]:
                for k in range(min(n-j,m)):
                    if s[j:j+k+1] not in tank:
                        tank.append(s[j:j+k+1])
        if len(tank)>=m:
            break
    tank.sort()
    print(tank[m-1])
    
if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    s=input()
    k=int(input())
    tank=[]
    n=len(s)
    for length in range(1,n+1):
        for i in range(n-length+1):
            if s[i:i+length] not in tank:
                tank.append(s[i:i+length])
    tank.sort()
    print(tank[k-1])      
    
if __name__ == "__main__":
    main()


Fixed submission:
def main():
    s=input()
    m=int(input())
    tank=[]
    n=len(s)
    alpha=[chr(i) for i in range(97, 97+26)]
    for i in range(26):
        for j in range(n):
            if alpha[i]==s[j]:
                for k in range(min(n-j,m)):
                    if s[j:j+k+1] not in tank:
                        tank.append(s[j:j+k+1])
        if len(tank)>=m:
            break
    tank.sort()
    print(tank[m-1])
    
if __name__ == "__main__":
    main()
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a = list(map(int,input().split()))
cnt=0
for i in range(n):
    for j in range(n-i):
        j+=i
        if sum(a[i:j+1])==0:
            cnt+=1
print(cnt)





Fixed submission:
n=int(input())
a = list(map(int,input().split()))
s=[0 for _ in range(n+1)]
for i in range(n):
    s[i+1]+=s[i]+a[i]
s.sort()
c=1
cnt=0
for i in range(n):
    if s[i]==s[i+1]:
        cnt+=c
        c+=1
    else:
        c=1
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))	
cnt=0
for i in range(n):
    for j in range(n-i):
        j+=i+1
        if sum(a[i:j])==0:
            cnt+=1
print(cnt)






Fixed submission:
n=int(input())
a = list(map(int,input().split()))
s=[0 for _ in range(n+1)]
for i in range(n):
    s[i+1]+=s[i]+a[i]
s.sort()
c=1
cnt=0
for i in range(n):
    if s[i]==s[i+1]:
        cnt+=c
        c+=1
    else:
        c=1
print(cnt)
Buggy python submission (verdict: Runtime Error):
n=int(input())
name={}
name["M"]=0
name["A"]=0
name["R"]=0
name["C"]=0
name["H"]=0
for _ in range(n):
    s=list(input())
    if s[0] not in name:
        name[s[0]]=1
    else:
        name[s[0]]+=1
cnt=[name["M"],name["A"],name["R"],name["C"],name["H"]]
ans=0
for i in range(n-2):
    for j in range(n-i-2):
        j+=i+1
        for k in range(n-j-1):
            k+=j+1
            ans+=cnt[i]*cnt[j]*cnt[k]
print(ans)


Fixed submission:
n=int(input())
name={}
name["M"]=0
name["A"]=0
name["R"]=0
name["C"]=0
name["H"]=0
for _ in range(n):
    s=list(input())
    if s[0] not in name:
        name[s[0]]=1
    else:
        name[s[0]]+=1
cnt=[name["M"],name["A"],name["R"],name["C"],name["H"]]
ans=0
n=5
for i in range(n-2):
    for j in range(n-i-2):
        j+=i+1
        for k in range(n-j-1):
            k+=j+1
            ans+=cnt[i]*cnt[j]*cnt[k]
print(ans)
Buggy python submission (verdict: Runtime Error):
n=int(input())
if n < 10 :
    print(n)
else:
    n=list(str(n))
    key=0
    for i in range(n):
        if n[1+i]!="9":
            key=1
    if key ==0:
        print((len(n)-1)*9+int(n[0]))
    else:
        print((len(n)-1)*9+int(n[0])-1)




Fixed submission:
n=int(input())
if n < 10 :
    print(n)
else:
    n=list(str(n))
    key=0
    for i in range(len(n)-1):
        if n[1+i]!="9":
            key=1
    if key ==0:
        print((len(n)-1)*9+int(n[0]))
    else:
        print((len(n)-1)*9+int(n[0])-1)
Buggy python submission (verdict: Runtime Error):
n=int(input())
ans=1
for i in range(n):
    i=n-i
    for j in range(3):
        j+=int(i**0.5)-1
        if(i//j==j and i%j==0):
            ans=i
            break
    if(ans!=1):
        break
        
print(ans)
    

Fixed submission:
n=int(input())
ans=1
if(n==1 or n==2 or n==3):
    ans=1
else:
    for i in range(n):
        i=n-i
        for j in range(3):
            j+=int(i**0.5)-1
            if(i//j==j and i%j==0):
                ans=i
                break
        if(ans!=1):
            break
        
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
sys.setrecursionlimit(10**8)

def main():
    n,k = map(int,input().split())
    xy = []
    X = []
    Y = []
    for _ in range(n):
        x,y = map(int,input().split())
        xy.append((x,y))
        X.append(x)
        Y.append(y)
    ans = 10**20
    for i in range(n-1):
        for j in range(i+1,n):
            for a in range(n-1):
                for b in range(a+1,n):
                    xl,xr = X[i],X[j]
                    yd,yu = Y[a],Y[b]
                    if xl > xr:
                        xr,xl = xl,xr
                    if yd > yu:
                        yd,yu = yu,yd
                    area = (xr-xl)*(yu-yd)
                    if ans < area:
                        continue
                    cnt = 0
                    for c in range(n):
                        if xl <= xy[c][0] and xy[c][0] <= xr and yd <= xy[c][1] and xy[c][1] <= yu:
                            cnt += 1
                    if cnt >= k:
                        ans = min(ans,area)
    print(ans)

if __name__ == "__main__":
    main()

Fixed submission:
import sys
sys.setrecursionlimit(10**8)

def main():
    n,k = map(int,input().split())
    xy = []
    X = []
    Y = []
    for _ in range(n):
        x,y = map(int,input().split())
        xy.append((x,y))
        X.append(x)
        Y.append(y)
    ans = 10**20
    for i in range(n-1):
        for j in range(i+1,n):
            for a in range(n-1):
                for b in range(a+1,n):
                    xl,xr = X[i],X[j]
                    yd,yu = Y[a],Y[b]
                    if xl > xr:
                        xr,xl = xl,xr
                    if yd > yu:
                        yd,yu = yu,yd
                    area = (xr-xl)*(yu-yd)
                    if ans < area:
                        continue
                    cnt = 0
                    for c in range(n):
                        if xl <= xy[c][0] and xy[c][0] <= xr and yd <= xy[c][1] and xy[c][1] <= yu:
                            cnt += 1
                    if cnt >= k:
                        ans = min(ans,area)
    print(ans)

if __name__ == "__main__":
    main()
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a = list(map(int,input().split()))	
m=n*(10**9)
for i in range(n-1):
    if m > abs(sum(a[:i+1])-sum(a[i+1:])):
        m=abs(sum(a[:i+1])-sum(a[i+1:]))
print(m)





Fixed submission:
n=int(input())
a = list(map(int,input().split()))	
m=n*(10**9)
s=sum(a)
M=0
for i in range(n-1):
    M+=a[i]
    if abs(s-2*M) < m:
        m=abs(s-2*M)
print(m)
Buggy python submission (verdict: Runtime Error):
import sys, bisect, math, itertools, string, queue, copy
# import numpy as np
# import scipy
from collections import Counter,defaultdict,deque
from itertools import permutations, combinations
from heapq import heappop, heappush
input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(input()) # n=1
def inpm(): return map(int,input().split()) # x=1,y=2
def inpl(): return list(map(int, input().split())) # a=[1,2,3,4,5,...,n]
def inpls(): return list(input().split())  # a=['1','2','3',...,'n']
def inplm(n): return list(int(input()) for _ in range(n)) # x=[] 複数行
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return sorted([list(map(int, input().split())) for _ in range(n)]) # [[1,1,1,1],[2,2,2,2],[3,3,3,3]] 
def graph():
    n=inp()
    g=[[] for _ in range(n)]
    for i in range(n):
        a = inp()
        a -= 1
        g[i].append(a)
        g[a].append(i)
    return n,g

def main():
    n,m = inp()
    cnt = [0 for _ in range(n)]
    for _ in range(m):
        a,b = inpm()
        a -= 1
        b -= 1
        cnt[a] += 1
        cnt[b] += 1
    for i in range(n):
        if cnt[i]%2 == 1:
            print('NO')
            return
    print('YES')
 
if __name__ == "__main__":
    main()

Fixed submission:
import sys, bisect, math, itertools, string, queue, copy
# import numpy as np
# import scipy
from collections import Counter,defaultdict,deque
from itertools import permutations, combinations
from heapq import heappop, heappush
input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(input()) # n=1
def inpm(): return map(int,input().split()) # x=1,y=2
def inpl(): return list(map(int, input().split())) # a=[1,2,3,4,5,...,n]
def inpls(): return list(input().split())  # a=['1','2','3',...,'n']
def inplm(n): return list(int(input()) for _ in range(n)) # x=[] 複数行
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return sorted([list(map(int, input().split())) for _ in range(n)]) # [[1,1,1,1],[2,2,2,2],[3,3,3,3]] 
def graph():
    n=inp()
    g=[[] for _ in range(n)]
    for i in range(n):
        a = inp()
        a -= 1
        g[i].append(a)
        g[a].append(i)
    return n,g

def main():
    n,m = inpm()
    cnt = [0 for _ in range(n)]
    for _ in range(m):
        a,b = inpm()
        a -= 1
        b -= 1
        cnt[a] += 1
        cnt[b] += 1
    for i in range(n):
        if cnt[i]%2 == 1:
            print('NO')
            return
    print('YES')
 
if __name__ == "__main__":
    main()