#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
;
const long long maxn = 1e6;
vector<long long> ANS1;
vector<long long> ANS2;
vector<long long> ANS3;
vector<long long> ANS4;
long long A[maxn];
long long B[maxn];
int main() {
  long long q, w, e, r, n, m, k, a, b;
  string s;
  cin >> n;
  for (q = 0; q < n - 1; q++) {
    cin >> A[q];
  }
  for (q = 0; q < n - 1; q++) {
    cin >> B[q];
  }
  bool f1 = 0, f2 = 0, f3 = 0, f4 = 0;
  ANS1.push_back(0);
  ANS2.push_back(1);
  ANS3.push_back(2);
  ANS4.push_back(3);
  for (q = 0; q < n - 1; q++) {
    if ((A[q] | B[q]) != A[q]) {
      cout << "NO";
      return 0;
    }
    if (ANS1[ANS1.size() - 1] == (A[q] & B[q])) {
      ANS1.push_back(A[q] | B[q]);
    } else {
      if (ANS1[ANS1.size() - 1] == (A[q] | B[q])) {
        ANS1.push_back(A[q] & B[q]);
      } else {
        if (A[q] == 3 && B[q] == 0) {
          ANS1.push_back(3 - ANS1[ANS1.size() - 1]);
        } else {
          f1 = 1;
        }
      }
    }
    if (ANS3[ANS3.size() - 1] == (A[q] & B[q])) {
      ANS3.push_back(A[q] | B[q]);
    } else {
      if (ANS3[ANS3.size() - 1] == (A[q] | B[q])) {
        ANS3.push_back(A[q] & B[q]);
      } else {
        if (A[q] == 3 && B[q] == 0) {
          ANS3.push_back(3 - ANS3[ANS3.size() - 1]);
        } else {
          f3 = 1;
        }
      }
    }
    if (ANS4[ANS4.size() - 1] == (A[q] & B[q])) {
      ANS4.push_back(A[q] | B[q]);
    } else {
      if (ANS4[ANS4.size() - 1] == (A[q] | B[q])) {
        ANS4.push_back(A[q] & B[q]);
      } else {
        if (A[q] == 3 && B[q] == 0) {
          ANS4.push_back(3 - ANS4[ANS4.size() - 1]);
        } else {
          f4 = 1;
        }
      }
    }
    if (ANS2[ANS2.size() - 1] == (A[q] & B[q])) {
      ANS2.push_back(A[q] | B[q]);
    } else {
      if (ANS2[ANS2.size() - 1] == (A[q] | B[q])) {
        ANS2.push_back(A[q] & B[q]);
      } else {
        if (A[q] == 3 && B[q] == 0) {
          ANS2.push_back(3 - ANS2[ANS2.size() - 1]);
        } else {
          f2 = 1;
        }
      }
    }
  }
  if (f1 && f2 && f3 && f4) {
    cout << "NO";
    return 0;
  }
  cout << "YES" << endl;
  if (!f3) {
    for (q = 0; q < ANS3.size(); q++) {
      cout << ANS3[q] << " ";
    }
    return 0;
  }
  if (!f4) {
    for (q = 0; q < ANS4.size(); q++) {
      cout << ANS4[q] << " ";
    }
    return 0;
  }
  if (!f1) {
    for (q = 0; q < ANS1.size(); q++) {
      cout << ANS1[q] << " ";
    }
  } else {
    for (q = 0; q < ANS2.size(); q++) {
      cout << ANS2[q] << " ";
    }
  }
  return 0;
}
