#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a[100], now[3], flag;
  while (cin >> n) {
    flag = 0;
    now[1] = 1;
    now[2] = 2;
    now[0] = 3;
    for (int i = 0; i < n; i++) cin >> a[i];
    for (int i = 0; i < n; i++) {
      if (a[i] == now[0]) {
        flag = 1;
        break;
      } else if (a[i] == now[1])
        swap(now[2], now[0]);
      else if (a[i] == now[2])
        swap(now[1], now[0]);
    }
    if (!flag)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
