def main():
    from collections import Counter

    n = int(input())
    *a, = map(int, input().split())

    if n % 3 == 0:
        ctr = Counter(a)
        if (len(ctr) == 1) and (0 in Counter):
            print('Yes')
            return
        elif len(ctr) == 3:
            it = iter(ctr.keys())
            x = next(it)
            y = next(it)
            z = next(it)
            print('Yes' if x ^ y == z else 'No')
            return
    else:
        print('Yes' if all(map(lambda x: x == 0, a)) else 'No')
        return


if __name__ == '__main__':
    main()
