#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
const int INF = 1e9 + 7;
const long long LINF = 1000000000000000001LL;
const long double EPS = 1e-9;
const long double PI = 3.141592653589793;
inline void hi(void) {
  cout << fixed << setprecision(16);
  srand(INF);
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
inline void bye(void) { exit(0); }
signed main() {
  hi();
  int n;
  cin >> n;
  int spect = 3;
  for (int i = 0; i < n; ++i) {
    int now;
    cin >> now;
    if (now == spect) {
      cout << "NO\n";
      bye();
    } else {
      for (int i = 1; i <= 3; ++i) {
        if (spect != i && now != i) {
          spect = i;
          break;
        }
      }
    }
  }
  cout << "YES\n";
  bye();
}
