#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, w, s, k;
  cin >> n;
  int a[n];
  for (i = 0; i < n; i++) cin >> a[i];
  if (a[0] == 3) {
    cout << "NO";
    return 0;
  } else {
    if (a[0] == 1) {
      w = 1;
      s = 2;
    } else if (a[0] == 2) {
      w = 2;
      s = 1;
    }
  }
  for (i = 1; i < n; i++) {
    if (a[i] == 6 - w - s) {
      k = s;
      int ww = w;
      w = 6 - w - s;
      s = ww;
    } else {
      if (a[i] == w) {
        k = s;
        s = 6 - w - s;
      } else {
        if (a[i] != 6 - w - s && a[i] != w) {
          cout << "NO";
          return 0;
        }
      }
    }
  }
  cout << "YES";
}
