#include <bits/stdc++.h>
using namespace std;
long long choose(long long n, long long k);
bool isprime(long long n);
long long power(long long x, long long y, long long p);
long long power(long long x, long long y);
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  long long a[n], b[n];
  for (int i = 1; i < n; i++) cin >> a[i];
  for (int i = 1; i < n; i++) cin >> b[i];
  for (int k = 0; k < 4; k++) {
    long long ans[n];
    ans[1] = k;
    long long f = 1;
    for (int i = 1; i < n; i++) {
      long long f1 = 0;
      for (int j = 0; j < 4; j++) {
        if (a[i] == (ans[i] | j) && b[i] == (ans[i] & j))
          ans[i + 1] = j, f1 = 1;
      }
      if (f1 == 0) {
        f = 0;
        break;
      }
    }
    if (f) {
      cout << "YES" << endl;
      for (int i = 1; i < n + 1; i++) cout << ans[i] << " ";
      cout << endl;
      return 0;
    }
  }
  cout << "NO" << endl;
  return 0;
}
