#!/usr/bin/env python
# coding: utf-8

# In[6]:


N = int(input())
a = list(map(int, input().split()))


# In[7]:


if sum(a) == 0:
    print("Yes")
else:
    if N%3 == 0:
        a0 = a[0]
        for i in range(1,N):
            a0 ^= a[i]
        if a0 == 0:
            print("Yes")
        else:
            print("No")
    else:
        print("No")


# In[ ]:




