#include <bits/stdc++.h>
using namespace std;
int main() {
  long n;
  long a[101];
  bool played[101][4];
  long i;
  cin >> n;
  for (i = 0; i < n; i++) {
    played[i][1] = false;
    played[i][2] = false;
    played[i][3] = false;
  }
  played[0][1] = true;
  played[0][2] = true;
  played[0][3] = false;
  for (i = 0; i < n; i++) {
    cin >> a[i];
    if (!played[i][a[i]]) {
      cout << "NO";
      return 0;
    }
    played[i + 1][a[i]] = true;
    switch (a[i]) {
      case 1:
        if (played[i][2])
          played[i + 1][3] = true;
        else
          played[i + 1][2] = true;
        break;
      case 2:
        if (played[i][1])
          played[i + 1][3] = true;
        else
          played[i + 1][1] = true;
        break;
      case 3:
        if (played[i][1])
          played[i + 1][2] = true;
        else
          played[i + 1][1] = true;
        break;
    }
  }
  if (n == 1 && a[0] == 3) {
    cout << "NO";
    return 0;
  }
  cout << "YES";
  return 0;
}
