#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
template <typename T>
void DEBUG(string label, T value) {
  cerr << "[" << label << " = " << value << "]\n";
}
int main(int argv, char **argc) {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int g[4][4][4];
  for (int i = 0; i <= 3; ++i) {
    for (int j = 0; j <= 3; ++j) {
      for (int k = 0; k <= 3; ++k) {
        g[i][j][k] = -1;
      }
    }
  }
  for (int a = 0; a <= 3; ++a) {
    for (int b = 0; b <= 3; ++b) {
      for (int c = 0; c <= 3; ++c) {
        for (int d = 0; d <= 3; ++d) {
          if ((c | d) == a && (c & d) == b) {
            g[a][b][c] = d;
            break;
          }
        }
      }
    }
  }
  int n;
  cin >> n;
  int a[n], b[n];
  for (int i = 0; i < n - 1; ++i) {
    cin >> a[i];
  }
  for (int i = 0; i < n - 1; ++i) {
    cin >> b[i];
  }
  for (int i = 0; i <= 3; ++i) {
    vector<int> ans(n);
    ans[0] = i;
    bool found = true;
    for (int j = 1; j < n; ++j) {
      if (g[a[j - 1]][b[j - 1]][ans[j - 1]] == -1) {
        found = false;
        break;
      }
      ans[j] = g[a[j - 1]][b[j - 1]][ans[j - 1]];
    }
    if (found) {
      cout << "YES\n";
      for (auto e : ans) {
        cout << e << " ";
      }
      cout << '\n';
      return 0;
    }
  }
  cout << "NO\n";
}
