#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 100000;
char a[MAX_N][2], b[MAX_N][2];
int t[MAX_N][2];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, tmp;
  cin >> n;
  for (int i = 0; i < n - 1; ++i)
    cin >> tmp, a[i][0] = tmp & 1, a[i][1] = (tmp >> 1) & 1;
  for (int i = 0; i < n - 1; ++i)
    cin >> tmp, b[i][0] = tmp & 1, b[i][1] = (tmp >> 1) & 1;
  for (int i = 0; i < n - 1; ++i) {
    for (int j = 0; j < 2; ++j) {
      if (a[i][j] == 0 && b[i][j] == 0) {
        if (t[i][j] == 2) return cout << "NO\n", 0;
        t[i][j] = 1;
        t[i + 1][j] = 1;
      } else if (a[i][j] == 1 && b[i][j] == 0) {
        if (t[i][j] == 0)
          t[i][j] = 3;
        else
          t[i + 1][j] = 3 - t[i][j];
      } else if (a[i][j] == 1 && b[i][j] == 1) {
        if (t[i][j] == 1) return cout << "NO\n", 0;
        t[i][j] = 2;
        t[i + 1][j] = 2;
      } else {
        return cout << "NO\n", 0;
      }
    }
  }
  for (int j = 0; j < 2; ++j) {
    int firstOk = -1;
    for (int i = 0; i < n - 1; ++i) {
      if (t[i][j] != 3) {
        firstOk = i;
        break;
      }
    }
    if (firstOk == -1)
      for (int i = 0; i < n; ++i) t[i][j] = 1 + (i & 1);
    else {
      for (int i = firstOk; i--;) t[i][j] = 3 - t[i + 1][j];
      for (int i = firstOk + 1; i < n; ++i)
        if (t[i][j] == 3) {
          if (i != n - 2 && t[i + 1][j] != 3 && 3 - t[i + 1][j] == t[i][j])
            return cout << "NO\n", 0;
          else
            t[i][j] = 3 - t[i - 1][j];
        }
    }
  }
  cout << "YES\n";
  for (int i = 0; i < n; ++i) cout << ((t[i][1] - 1) * 2) + t[i][0] - 1 << " ";
  cout << '\n';
  return 0;
}
