#include <bits/stdc++.h>
using namespace std;
int n;
int a[1000005];
int b[1000005];
int dp[100005][5];
void Reset() {
  for (int i = 0; i < 100005; i++)
    for (int j = 0; j < 4; j++) dp[i][j] = -1;
}
bool func(int i, int prev) {
  bool ans = false;
  if (i == n - 1) {
    dp[i][prev] = true;
    return true;
  }
  if (dp[i][prev] != -1) return dp[i][prev];
  for (int j = 0; j <= 3; j++) {
    if ((prev | j) == a[i] && (prev & j) == b[i]) ans = ans || func(i + 1, j);
  }
  dp[i][prev] = ans;
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n;
  for (int i = 0; i < n - 1; i++) cin >> a[i];
  for (int i = 0; i < n - 1; i++) cin >> b[i];
  bool ans = false;
  for (int i = 0; i < n - 1; i++)
    if (b[i] > a[i]) {
      cout << "NO" << endl;
      return 0;
    }
  for (int i = 0; i <= 3; i++) {
    Reset();
    ans = func(0, i);
    if (ans) break;
  }
  if (!ans) {
    cout << "NO" << endl;
    return 0;
  }
  cout << "YES" << endl;
  for (int i = 0; i < n; i++)
    for (int j = 0; j <= 3; j++)
      if (dp[i][j] == 1) cout << j << " ";
  cout << endl;
}
