#include <bits/stdc++.h>
using namespace std;
int dp[100003][4];
int pr[100003][4];
int main(int argc, const char* argv[]) {
  vector<int> v;
  int a[100003];
  int b[100003];
  int n;
  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]);
  }
  dp[0][0] = dp[0][1] = dp[0][2] = dp[0][3] = 1;
  for (int i = 1; i <= n - 1; i++) {
    for (int j = 0; j <= 3; j++) {
      for (int k = 0; k <= 3; k++) {
        if (dp[i - 1][j] == 1 && ((j | k) == a[i]) && ((j & k) == b[i])) {
          pr[i][k] = j;
          dp[i][k] = 1;
        }
      }
    }
  }
  for (int j = 0; j <= 3; j++) {
    if (dp[n - 1][j] == 1) {
      int c = j;
      for (int i = n - 1; i >= 0; i--) {
        v.push_back(c);
        c = pr[i][c];
      }
      printf("YES\n");
      for (int i = v.size() - 1; i >= 0; i--) {
        printf("%d ", v[i]);
      }
      return 0;
    }
  }
  printf("NO\n");
  return 0;
}
