def main():
    n = int(input())
    *alist, = map(int, input().split())

    aset = list(set(alist))
    if len(aset) != 3:
        print('No')
        return

    a, b, c = aset
    if a ^ b != c:
        print('No')
        return

    acnt = {a: 0, b: 0, c: 0}
    for aa in alist:
        acnt[aa] += 1

    if acnt[a] != acnt[b] or acnt[b] != acnt[c]:
        print('No')
        return

    print('Yes')


main()
