#include <bits/stdc++.h>
using namespace std;
const double p = 3.1415926535897932384;
signed main() {
  long long n;
  cin >> n;
  long long a = 1, b = 2, c = 3;
  long long k;
  long long f = 0;
  for (long long i = 0; i < n; i++) {
    cin >> k;
    if (a == 1 && b == 2) {
      if (k == 3) {
        f = 1;
        break;
      }
      if (k == 1) {
        b = 3;
      }
      if (k == 2) {
        a = 2;
        b = 3;
      }
    } else if (a == 2 && b == 3) {
      if (k == 1) {
        f = 1;
        break;
      }
      if (k == 2) {
        a = 1;
        b = 2;
      }
      if (k == 3) {
        a = 1;
        b = 3;
      }
    } else if (a == 1 && b == 3) {
      if (k == 2) {
        f = 1;
        break;
      }
      if (k == 1) {
        a = 1;
        b = 2;
      }
      if (k == 3) {
        a = 2;
        b = 3;
      }
    }
  }
  if (f == 1) {
    cout << "NO" << endl;
  } else {
    cout << "YES" << endl;
  }
}
