#include <bits/stdc++.h>
using namespace std;
const long double PI = acos(-1);
int dx[] = {1, -1, 0, 0, 1, -1, 1, -1};
int dy[] = {0, 0, 1, -1, 1, -1, -1, 1};
int main() {
  int n;
  cin >> n;
  if (n > 3) {
    cout << "No" << endl;
    return 0;
  }
  int tem;
  cin >> tem;
  bitset<100> bs1 = tem;
  cin >> tem;
  bitset<100> bs2 = tem;
  cin >> tem;
  bitset<100> bs3 = tem;
  bitset<100> temp = bs1 ^ bs2;
  if (bs3 != temp) {
    cout << "No" << endl;
    return 0;
  }
  cout << "Yes" << endl;
}
