from collections import Counter

def main():
    num = int(input())
    data = list(map(int, input().split()))

    num_c = Counter(data)
    if len(num_c) > 3:
        print('No')
    else:
        if len(num_c) == 1:
            if num_c[0] == num:
                print('Yes')
            else:
                print('No')
        elif num % 3 == 0:
            if len(num_c) == 2:
                if num_c[0] == num // 3:
                    print('Yes')
                else:
                    print('No')
            else:
                ans = 0
                for ele in num_c.keys():
                    ans ^= ele
                if ans == 0:
                    print('Yes')
                else:
                    print('No')
        else:
            print('No')







if __name__ == '__main__':
    main()
