#include <bits/stdc++.h>
using namespace std;
int used[10000002];
int main() {
  ios::sync_with_stdio(false);
  int n, a[102], now;
  bool flag;
  while (cin >> n) {
    now = 3;
    flag = true;
    for (int i = 0; i < n; i++) cin >> a[i];
    for (int i = 0; i < n; i++) {
      if (a[i] == now) {
        flag = false;
        break;
      } else {
        if (a[i] == 1 && now == 2)
          now = 3;
        else if (a[i] == 1 && now == 3)
          now = 2;
        else if (a[i] == 2 && now == 1)
          now = 3;
        else if (a[i] == 2 && now == 3)
          now = 1;
        else if (a[i] == 3 && now == 1)
          now = 2;
        else if (a[i] == 3 && now == 2)
          now = 1;
      }
    }
    if (flag)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
