#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const int N = 1e6 + 4;
int solve() {
  int n;
  scanf("%d", &n);
  int a[n - 1], b[n - 1];
  for (int i = 0; i < n - 1; i++) scanf("%d", &a[i]);
  for (int i = 0; i < n - 1; i++) scanf("%d", &b[i]);
  int dp[n][4], prev[n][4];
  memset(dp, 0, sizeof(dp));
  for (int i = 0; i < 4; i++) dp[n - 1][i] = 1;
  for (int i = n - 2; i >= 0; i--) {
    for (int j = 0; j < 4; j++) {
      for (int k = 0; k < 4; k++)
        if (dp[i + 1][k]) {
          if ((j | k) == a[i] and (j & k) == b[i]) dp[i][j] = 1, prev[i][j] = k;
        }
    }
  }
  int pehla = -1;
  for (int i = 0; i < 4; i++)
    if (dp[0][i]) pehla = i;
  if (pehla == -1) {
    printf("NO");
    return 0;
  }
  printf("YES\n");
  for (int i = 0; i < n; i++) {
    printf("%d ", pehla);
    pehla = prev[i][pehla];
  }
  return 0;
}
int main() {
  int t;
  t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
