#include <bits/stdc++.h>
using namespace std;
int n, m, a[101], cnt[31], cur;
string s;
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  int cur1 = 0, cur2 = 0, cur3 = -1;
  for (int i = 1; i <= n; i++) {
    if (a[i] == 1) {
      if (cur1 == -1) {
        cout << "NO";
        return 0;
      }
      swap(cur2, cur3);
    }
    if (a[i] == 2) {
      if (cur2 == -1) {
        cout << "NO";
        return 0;
      }
      swap(cur1, cur3);
    }
    if (a[i] == 3) {
      if (cur3 == -1) {
        cout << "NO";
        return 0;
      }
      swap(cur1, cur2);
    }
  }
  cout << "YES";
}
