Problem p02975 (python)

Fixed submission:
import collections

N = int(input())
a = list(map(int,input().split()))
a = collections.Counter(a)

value, count = list(a.keys()), list(a.values())

if len(value)<3:
    if len(value)==1:
        if sum(a)==0:
            print('Yes')
        else:
            print('No')

    if len(value)==2:
        if 0 in value:
            if count[0]==N/3 or count[1]==N/3:
                print('Yes')
            else:
                print('No')

        else:
            print('No')

if len(value)>=3:
    if count[0]+count[1]+count[2] == N:
        if value[0]^value[1]^value[2] == 0:
            if count[0]==count[1]==count[2]:
                print('Yes')
            else:
                print('No')
        else:
            print('No')
    else:
        print('No')

Buggy submission (verdict: Runtime Error):
import collections

N = int(input())
a = list(map(int,input().split()))
a = collections.Counter(a)

value, count = list(a.keys()), list(a.values())

if len(value)<3:
    if len(value)==1
        if sum(a)==0:
            print('Yes')
        else:
            print('No')

    if len(value)==2
        if 0 in value:
            if count[0]==N/3 or count[1]==N/3:
                print('Yes')
            else:
                print('No')

        else:
            print('No')

if len(value)>=3:
    if count[0]+count[1]+count[2] == N:
        if value[0]^value[1]^value[2] == 0:
            if count[0]==count[1]==count[2]:
                print('Yes')
            else:
                print('No')

    else:
        print('No')

Buggy submission (verdict: Runtime Error):
import collections

N = int(input())
a = list(map(int,input().split()))
a = collections.Counter(a)

value, count = list(a.keys()), list(a.values())

if len(value)<3:
    if len(value)==1
        if sum(a)==0:
            print('Yes')
        else:
            print('No')

    if len(value)==2
        if 0 in value:
            if count[0]==N/3 or count[1]==N/3:
                print('Yes')

if len(value)>=3:
    if count[0]+count[1]+count[2] != N:
        print('No')

    elif value[0]^value[1]^value[2] != 0:
        print('No')

    elif count[0]==count[1]==count[2]:
        print('Yes')

    else:
        print('No')

Buggy submission (verdict: Runtime Error):
import collections
import sys

N = int(input())
a = list(map(int,input().split()))
a = collections.Counter(a)

value, count = list(a.keys()), list(a.values())

if sum(a)==0:
    print('Yes')
    sys.exit()

elif len(value)<2:
    print('No')
    sys.exit()

elif count[0]+count[1]+count[2] != N:
    print('No')

elif value[0]^value[1]^value[2] != 0:
    print('No')

elif count[0]==count[1]==count[2]:
    print('Yes')

else:
    print('No')

Buggy submission (verdict: Runtime Error):
import collections
import sys
sys.setrecursionlimit(10000)

N = int(input())
a = list(map(int,input().split()))
a = collections.Counter(a)

value, count = list(a.keys()), list(a.values())

if count[0]+count[1]+count[2] != N:
    print('No')

elif value[0]^value[1]^value[2] != 0:
    print('No')

elif count[0]==count[1]==count[2]:
    print('Yes')

else:
    print('No')

Buggy submission (verdict: Runtime Error):
import collections

N = int(input())
a = list(map(int,input().split()))
a = collections.Counter(a)

value, count = list(a.keys()), list(a.values())

if count[0]+count[1]+count[2] != N:
    print('No')

elif value[0]^value[1]^value[2] != 0:
    print('No')

elif count[0]==count[1]==count[2]:
    print('Yes')

else:
    print('No')

Buggy submission (verdict: Runtime Error):
import collections

N = int(input())
a = list(map(int,input().split()))
a = collections.Counter(a)

value, count = zip(*a.most_common())

if count[0]+count[1]+count[2] != N:
    print('No')

elif value[0]^value[1]^value[2] != 0:
    print('No')

elif count[0]==count[1]==count[2]:
    print('Yes')

else:
    print('No')

Buggy submission (verdict: Runtime Error):
import collections
import sys

N = int(input())
a = list(map(int,input().split()))
a = collections.Counter(a)

value, count = zip(*a.most_common())

if count[0]+count[1]+count[2] != N:
    print('No')
    sys.exit()

if value[0]^value[1]^value[2] != 0:
    print('No')
    sys.exit()

if count[0]==count[1]==count[2]:
    print('Yes')
    sys.exit()

print('No')