#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
const int INF = 1e9 + 5;
const int MOD = 1e9 + 7;
double pi = 2 * acos(0.0);
void solve() {
  int n;
  cin >> n;
  int a[n - 1], b[n - 1];
  vector<int> c;
  for (int i = 0; i < n - 1; ++i) cin >> a[i];
  for (int i = 0; i < n - 1; ++i) cin >> b[i];
  bool f = 0;
  vector<pair<int, int> > possibilities;
  for (int i = 0; i < 4; ++i) {
    for (int j = 0; j < 4; ++j) {
      int x = i | j, y = i & j;
      if (x == a[0] and y == b[0]) {
        possibilities.push_back({i, j});
        f = 1;
      }
    }
  }
  if (!f) {
    cout << "NO\n";
    return;
  }
  int x = possibilities.size();
  int dp[x][n];
  memset(dp, -1, sizeof(dp));
  for (int i = 0; i < x; ++i)
    dp[i][0] = possibilities[i].first, dp[i][1] = possibilities[i].second;
  for (int j = 1; j < n - 1; ++j) {
    bool f1 = 0;
    for (int i = 0; i < x; ++i) {
      for (int k = 0; k < 4; ++k) {
        int x = dp[i][j] | k, y = dp[i][j] & k;
        if (x == a[j] and y == b[j]) {
          dp[i][j + 1] = k;
          f1 = 1;
          break;
        }
      }
    }
    if (!f1) {
      cout << "NO\n";
      return;
    }
  }
  for (int i = 0; i < x; ++i) {
    bool f = 1;
    for (int j = 0; j < n; ++j) {
      if (dp[i][j] == -1) {
        f = 0;
        break;
      }
    }
    if (f) {
      cout << "YES\n";
      for (int j = 0; j < n; ++j) {
        cout << dp[i][j] << ' ';
      }
      cout << '\n';
      return;
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  int t = 1;
  while (t--) solve();
  return 0;
}
