#include <bits/stdc++.h>
#pragma GCC optimize("O3")
std::pair<int, int> DR[] = {{-1, 0}, {0, 1},   {1, 0}, {0, -1},
                            {-1, 1}, {-1, -1}, {1, 1}, {1, -1}};
using namespace std;
int n, a[1 << 17];
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cerr.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  vector<int> vec;
  vec.push_back(1);
  vec.push_back(2);
  vec.push_back(3);
  bool b = 1;
  int spec = vec[2];
  for (int i = 1; i <= n; i++) {
    if (spec == a[i])
      b = 0;
    else {
      if (spec == 1 && a[i] == 2)
        spec = 3;
      else if (spec == 1 && a[i] == 3)
        spec = 2;
      else if (spec == 2 && a[i] == 3)
        spec = 1;
      else if (spec == 2 && a[i] == 1)
        spec = 3;
      else if (spec == 3 && a[i] == 1)
        spec = 2;
      else if (spec == 3 && a[i] == 2)
        spec = 1;
    }
  }
  if (b) return cout << "YES", 0;
  return cout << "NO", 0;
}
