#include <bits/stdc++.h>
using namespace std;
long long a[555];
long long n;
long long check[5];
long long check1;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  check[1] = 1;
  check[2] = 1;
  check1 = 3;
  for (int i = 1; i <= n; i++) {
    if (check[a[i]] == 0) {
      cout << "NO";
      return 0;
    } else {
      check[1] = 0;
      check[2] = 0;
      check[3] = 0;
      check[check1] = 1;
      check[a[i]] = 1;
      for (int i = 1; i <= 3; i++) {
        if (check[i] == 0) {
          check1 = i;
          break;
        }
      }
    }
  }
  cout << "YES";
  return 0;
}
