def main():
    import sys
    import collections
    input = sys.stdin.readline
    n = int(input().rstrip('\n'))
    a = collections.Counter(list(map(int, input().rstrip('\n').split()))).most_common()
    if len(a) == 3:
        if a[0][0] ^ a[1][0] ^ a[2][0] == 0 and a[0][1] == a[1][1] == a[2][1]:
            print("Yes")
            exit()
    elif len(a) == 2:
        if (a[0][0] == 0 and a[0][1] == a[1][1] ** 2) or (a[1][0] == 0 and a[1][1] == a[0][1] ** 2):
            print("Yes")
            exit()
    elif len(a) == 1 and a[0][0] == 0:
        print("Yes")
        exit()
    print("No")


if __name__ == '__main__':
    main()
