#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n - 1), b(n - 1), t(n, -1);
  for (int i = 0; i < n - 1; i++) cin >> a[i];
  for (int i = 0; i < n - 1; i++) cin >> b[i];
  vector<bool> flagt(4, true);
  for (t[0] = 0; t[0] < 4; t[0]++) {
    for (int i = 0; i < n - 1; i++) {
      bool flag = false;
      for (t[i + 1] = 0; t[i + 1] < 4; t[i + 1]++) {
        if ((a[i] == (t[i] | t[i + 1])) && (b[i] == (t[i] & t[i + 1]))) {
          flag = true;
          break;
        }
      }
      if (flag == false) {
        flagt[t[0]] = false;
        break;
      }
    }
    if (flagt[t[0]] == true) {
      cout << "YES" << endl;
      for (int i = 0; i < n; i++) cout << t[i] << " ";
      return 0;
    }
  }
  cout << "NO";
}
