#include <bits/stdc++.h>
using namespace std;
const long long INF = 1000 * 1000 * 1000 + 228;
signed main() {
  long long n;
  cin >> n;
  vector<long long> a(n - 1), b(n - 1);
  for (long long i = 0; i < n - 1; ++i) {
    cin >> a[i];
  }
  for (long long i = 0; i < n - 1; ++i) {
    cin >> b[i];
    if (b[i] > a[i]) {
      cout << "NO";
      return 0;
    }
  }
  vector<long long> t(n);
  for (long long j = 0; j <= 3; ++j) {
    t[0] = j;
    bool st = true;
    for (long long i = 1; i < n; ++i) {
      t[i] = -1;
      for (long long l = 0; l <= 3; ++l) {
        if ((t[i - 1] & l) == b[i - 1] && (t[i - 1] | l) == a[i - 1]) {
          t[i] = l;
          break;
        }
      }
      if (t[i] == -1) {
        st = false;
        break;
      }
    }
    if (st) {
      cout << "YES" << '\n';
      for (auto i : t) {
        cout << i << " ";
      }
      return 0;
    }
  }
  cout << "NO";
}
