def sol(N, _as):
    if N % 3 != 0:
        return False

    first = _as.pop()
    for second in _as:
        success = True
        __as = _as[:]
        __as.remove(second)
        latest = second
        pre_latest = first
        while len(__as) > 0:
            _latest = latest
            latest = pre_latest^latest
            pre_latest = _latest
            try:
                __as.remove(latest)
            except ValueError:
                success = False
                break
        if success and pre_latest^latest == first:
            return True
    return False


def solve(N, _as):
    if N % 3 != 0:
        return False

    max_bit_len = 0
    max_bit_len_ints = []
    other_ints = []
    for a in _as:
        bl = int.bit_length(a)
        if bl > max_bit_len:
            max_bit_len = bl
            other_ints.extend(max_bit_len_ints)
            max_bit_len_ints.clear()
            max_bit_len_ints.append(a)
        elif bl == max_bit_len:
            max_bit_len_ints.append(a)
        else:
            other_ints.append(a)

    if N / 3 != len(other_ints):
        return False

    first = max_bit_len_ints.pop()
    for second in other_ints:
        return _solve(first, second, max_bit_len_ints, other_ints)


def _solve(first, second, _max_bit_len_ints, _other_ints):
    max_bit_len_ints = _max_bit_len_ints[:]
    other_ints = _other_ints[:]
    other_ints.remove(second)

    pre_latest = second
    latest = first^second
    try:
        max_bit_len_ints.remove(latest)
    except ValueError:
        return False

    count = 0
    while len(max_bit_len_ints) > 0 and len(other_ints) > 0:
        _latest = latest
        latest = pre_latest^latest
        pre_latest = _latest
        if count == 0 or count == 2:
            try:
                max_bit_len_ints.remove(latest)
            except ValueError:
                return False
        else:
            try:
                other_ints.remove(latest)
            except ValueError:
                return False
        count = (count + 1) % 3

    return pre_latest^latest == first


if __name__ == '__main__':
    N = int(input())
    _as = [int(x) for x in input().split()]
    print('Yes' if sol(N, _as) else 'No')
