def main():
    N = int(input())
    A = [int(a) for a in input().split()]
    d = dict()
    for a in A: d[a] = d.get(a, 0) + 1

    if len(d) == 1:
        a = list(d.keys())[0]
        if a == 0:
            return "Yes"
    elif len(d) == 2:
        a, b = list(d.keys())
        if (a == 0 or b == 0) and (d[a] == d[b]):
            return "Yes"
    elif len(d) == 3:
        a, b, c = list(d.keys())
        if d[a] == d[b] == d[c]:
            if (a^b == c and b^c == a and c^a == b) or (a^c == b and c^b == a and b^a == c):
                return "Yes"
    return "No"

if __name__ == '__main__':
    print(main())