#include <bits/stdc++.h>
using namespace std;
int n, a[100001], b[100001], f[100001];
bool check(int k) {
  f[1] = k;
  for (int i = 2; i <= n; i++) {
    int tmp = -1;
    for (int j = 0; j <= 3; j++)
      if (a[i] == (j | f[i - 1]) && b[i] == (j & f[i - 1])) tmp = j;
    if (tmp < 0) return false;
    f[i] = tmp;
  }
}
void print() {
  printf("YES\n");
  for (int i = 1; i <= n; i++) printf("%d%c", f[i], i < n ? ' ' : '\n');
}
int main() {
  scanf("%d", &n);
  for (int i = 2; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 2; i <= n; i++) scanf("%d", &b[i]);
  for (int i = 0; i <= 3; i++)
    if (check(i)) return print(), 0;
  printf("NO\n");
  return 0;
}
