#include <bits/stdc++.h>
using namespace std;
void re_curse() {
  long long int n;
  cin >> n;
  vector<long long int> arr(n);
  for (int i = 0; i < n; ++i) {
    cin >> arr[i];
  }
  long long int o = 3;
  if (arr[0] == o) {
    cout << "NO" << endl;
    return;
  }
  for (int i = 0; i < n - 1; ++i) {
    if (arr[i + 1] == 6 - (arr[i] + o)) {
      cout << "NO" << endl;
      return;
    }
    o = 6 - (arr[i] + o);
  }
  cout << "YES" << endl;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  for (int i = 1; i <= t; ++i) {
    re_curse();
  }
  return 0;
}
