Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
A = list(set(a))
A.sort()
if len(A) == 1:
    if A[0] == 0:
        ans = "Yes"
elif len(A) == 2:
    if A[0] == 0:
        if a.count(A[1]) == 2* (n // 3) :
            ans = "Yes"
elif len(A) == 3:
    if A[0]^A[1]^A[2] == 0:
        if a.count(A[0]) == n//3:
            if a.count(A[1]) == n//3:
                if a.count(A[2]) == n//3:
                    ans = "Yes"
else:
    ans = "No"

print(ans)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
A = list(set(a))
A.sort()
ans = "No"
if len(A) == 1:
    if A[0] == 0:
        ans = "Yes"
elif len(A) == 2:
    if A[0] == 0:
        if a.count(A[1]) == 2* (n // 3) :
            ans = "Yes"
elif len(A) == 3:
    if A[0]^A[1]^A[2] == 0:
        if a.count(A[0]) == n//3:
            if a.count(A[1]) == n//3:
                if a.count(A[2]) == n//3:
                    ans = "Yes"
print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
A = list(set(a))
A.sort()
if A == [0]:
    ans = "Yes"
elif len(A) == 2:
    if A[0] == 0:
        if a.count(A[1]) == 2* (n // 3) :
            ans = "Yes"
elif len(A) == 3:
    if A[0]^A[1]^A[2] == 0:
        if a.count(A[0]) == n//3:
            if a.count(A[1]) == n//3:
                if a.count(A[2]) == n//3:
                    ans = "Yes"
else:
    ans = "No"

print(ans)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
A = list(set(a))
A.sort()
ans = "No"
if len(A) == 1:
    if A[0] == 0:
        ans = "Yes"
elif len(A) == 2:
    if A[0] == 0:
        if a.count(A[1]) == 2* (n // 3) :
            ans = "Yes"
elif len(A) == 3:
    if A[0]^A[1]^A[2] == 0:
        if a.count(A[0]) == n//3:
            if a.count(A[1]) == n//3:
                if a.count(A[2]) == n//3:
                    ans = "Yes"
print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
A = list(set(a))
if A == (0):
    ans = "Yes"
elif len(A) == 2 and 0 in A:
    if a.count(A[1]) == (2*n // 3) :
        ans = "Yes"
elif len(A) == 3:
    if A[0]^A[1]^A[2] == 0:
        if a.count(A[0]) == n//3:
            if a.count(A[1]) == n//3:
                if a.count(A[2]) == n//3:
                    ans = "Yes"
else:
    ans = "No"

print(ans)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
A = list(set(a))
A.sort()
ans = "No"
if len(A) == 1:
    if A[0] == 0:
        ans = "Yes"
elif len(A) == 2:
    if A[0] == 0:
        if a.count(A[1]) == 2* (n // 3) :
            ans = "Yes"
elif len(A) == 3:
    if A[0]^A[1]^A[2] == 0:
        if a.count(A[0]) == n//3:
            if a.count(A[1]) == n//3:
                if a.count(A[2]) == n//3:
                    ans = "Yes"
print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
A = set(a)
if A == (0):
    ans = "Yes"
elif len(A) == 2 and 0 in A:
    b = list(A)
    if a.count(b[1]) == (2*n // 3) :
        ans = "Yes"
elif len(A) == 3:
    b = list(A)
    if b[0]^b[1]^b[2] == 0:
        if a.count(b[0]) == n//3:
            if a.count(b[1]) == n//3:
                if a.count(b[2]) == n//3:
                    ans = "Yes"
else:
    ans = "No"

print(ans)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
A = list(set(a))
A.sort()
ans = "No"
if len(A) == 1:
    if A[0] == 0:
        ans = "Yes"
elif len(A) == 2:
    if A[0] == 0:
        if a.count(A[1]) == 2* (n // 3) :
            ans = "Yes"
elif len(A) == 3:
    if A[0]^A[1]^A[2] == 0:
        if a.count(A[0]) == n//3:
            if a.count(A[1]) == n//3:
                if a.count(A[2]) == n//3:
                    ans = "Yes"
print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
A = set(a)
if A == (0):
    ans = "Yes"
elif len(A) == 2 and 0 in A:
    b = list(A)
    if a.count(b[1]) == (2*n // 3) :
        ans = "Yes"
elif len(A) == 3:
    b = list(A)
    if b[0]^b[1]^b[2] == 0:
        if a.count(b[0]) == n//3 and a.count(b[1]) == n//3 and a.count(b[2]) == n//3:
            ans = "Yes"
else:
    ans = "No"

print(ans)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
A = list(set(a))
A.sort()
ans = "No"
if len(A) == 1:
    if A[0] == 0:
        ans = "Yes"
elif len(A) == 2:
    if A[0] == 0:
        if a.count(A[1]) == 2* (n // 3) :
            ans = "Yes"
elif len(A) == 3:
    if A[0]^A[1]^A[2] == 0:
        if a.count(A[0]) == n//3:
            if a.count(A[1]) == n//3:
                if a.count(A[2]) == n//3:
                    ans = "Yes"
print(ans)