#include <bits/stdc++.h>
using namespace std;
int *a, *b, *t;
long n;
bool ok;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  t = new int[n];
  a = new int[n - 1];
  b = new int[n - 1];
  for (long i = (0); i != (n - 1); ++i) cin >> a[i];
  for (long i = (0); i != (n - 1); ++i) cin >> b[i];
  for (long fbit = (0); fbit != (4); ++fbit) {
    for (long sbit = (0); sbit != (4); ++sbit) {
      if (((fbit | sbit) == a[0]) && ((fbit & sbit) == b[0])) {
        t[0] = fbit;
        t[1] = sbit;
        ok = true;
        for (long i = (1); i != (n - 1); ++i) {
          bool nofind = true;
          for (long bit = (0); bit != (4); ++bit) {
            if (((t[i] | bit) == a[i]) && ((t[i] & bit) == b[i])) {
              t[i + 1] = bit;
              nofind = false;
              break;
            }
          }
          if (nofind) {
            ok = false;
            break;
          }
        }
        if (ok) {
          cout << "YES" << endl;
          for (long i = (0); i != (n - 1); ++i) cout << t[i] << ' ';
          cout << t[n - 1] << endl;
          return 0;
        }
        t[0] = sbit;
        t[1] = fbit;
        ok = true;
        for (long i = (1); i != (n - 1); ++i) {
          bool nofind = true;
          for (long bit = (0); bit != (4); ++bit) {
            if (((t[i] | bit) == a[i]) && ((t[i] & bit) == b[i])) {
              t[i + 1] = bit;
              nofind = false;
              break;
            }
          }
          if (nofind) {
            ok = false;
            break;
          }
        }
        if (ok) {
          cout << "YES" << endl;
          for (long i = (0); i != (n - 1); ++i) cout << t[i] << ' ';
          cout << t[n - 1] << endl;
          return 0;
        }
      }
    }
  }
  cout << "NO" << endl;
  return 0;
}
