using System;
using System.Collections.Generic;//list用
using System.Collections;
using System.Linq;
class Program
{
    static List<int> s = new List<int>();
    static List<char> t = new List<char>();
    static decimal result;
static int N;
    static void Main()
    {
Read1();
Read2();
        
  if((s[1]^s[N-1])==s[0]){}else{Console.WriteLine("No");return;}

for(int i=1;i<N-1;i++){
if((s[i+1]^s[i-1])==s[i]){}else{Console.WriteLine("No");return;}
}
   if((s[0]^s[N-2])==s[N-1]){}else{Console.WriteLine("No");return;}   
   

Console.WriteLine("Yes");

    }

    static void Read1()
    {
        string tmp = Console.ReadLine();
        N = int.Parse(tmp);
    }

    static void Read2()
    {
        string[] tmp=Console.ReadLine().Split(' ');
      for(int i=0;i<N;i++)
      {
        s.Add(int.Parse(tmp[i]));
      }
    }
}
