#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 7;
int n;
int a[MAXN], b[MAXN], ans[MAXN];
int flag;
void dfs(int x) {
  if (x < 1) {
    flag = 1;
    return;
  }
  for (int i = 0; i <= 3; i++) {
    if ((a[x] == (ans[x + 1] | i)) && (b[x] == (ans[x + 1] & i))) {
      ans[x] = i;
      dfs(x - 1);
    }
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n - 1; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= n - 1; i++) scanf("%d", &b[i]);
  for (int i = 0; i <= 3; i++) {
    ans[n] = i;
    dfs(n - 1);
    if (flag) {
      printf("YES\n");
      for (int i = 1; i <= n; i++) printf(i == n ? "%d\n" : "%d ", ans[i]);
      return 0;
    }
  }
  printf("NO\n");
  return 0;
}
