Problem: There are N cities in Bob's country connected by roads. Some pairs of cities are connected by public transport. There are two competing transport companies — Boblines operating buses and Bobrail running trains. When traveling from A to B, a passenger always first selects the mode of transport (either bus or train), and then embarks on a journey. For every pair of cities, there are exactly two ways of how to travel between them without visiting any city more than once — one using only bus routes, and the second using only train routes. Furthermore, there is no pair of cities that is directly connected by both a bus route and a train route.

You obtained the plans of each of the networks. Unfortunately, each of the companies uses different names for the same cities. More precisely, the bus company numbers the cities using integers from 1 to N, while the train company uses integers between N + 1 and 2N. Find one possible mapping between those two numbering schemes, such that no pair of cities is connected directly by both a bus route and a train route. Note that this mapping has to map different cities to different cities.

Input

The first line contains an integer N (2 ≤ N ≤ 10000), the number of cities.

N - 1 lines follow, representing the network plan of Boblines. Each contains two integers u and v (1 ≤ u, v ≤ N), meaning that there is a bus route between cities u and v.

N - 1 lines follow, representing the network plan of Bobrail. Each contains two integers u and v (N + 1 ≤ u, v ≤ 2N), meaning that there is a train route between cities u and v.

Output

If there is no solution, output a single line with the word "No".

If a solution exists, output two lines. On the first line, there should be the word "Yes". On the second line, there should be N integers P1, P2, ..., PN (N + 1 ≤ Pi ≤ 2N) — the mapping between the two numbering schemes. More precisely, for i ≠ j it should be Pi ≠ Pj, and for every direct bus route (i, j), there is no direct train route between (Pi, Pj).

If there are multiple solutions, you may print any of them.

Examples

Input

4
1 2
2 3
3 4
5 6
6 7
7 8


Output

Yes
6 8 5 7


Input

4
1 2
2 3
3 4
5 6
5 7
5 8


Output

No


Input

7
1 2
1 3
1 4
1 5
5 6
6 7
8 9
9 10
10 11
11 12
12 13
13 14


Output

Yes
9 14 11 12 13 10 8

Note

The first sample (bus lines in red and rail lines in blue):

<image>

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
struct edge {
  int v, nxt;
} e[500005];
int n, h[100005], t, deg[100005], vis[100005], vis2[100005];
int a[100005], b[100005], at, bt, m, tans[100005], d[100005];
int g[15][15], g2[15][15], p[15], pvis[15], tfl;
void add(int u, int v) {
  e[++t].v = v;
  e[t].nxt = h[u];
  h[u] = t;
}
void link(int u, int v) {
  tans[u] = v;
  vis[u] = vis[v] = 1;
}
void dfs(int u, int fa, int dep) {
  d[u] = dep;
  for (int i = h[u]; i; i = e[i].nxt) {
    int v = e[i].v;
    if (v == fa || vis[v]) continue;
    dfs(v, u, dep + 1);
  }
}
void tdfs(int dep) {
  if (dep == m + 1) {
    for (int i = 1; i <= m; i++)
      for (int j = 1; j <= m; j++)
        if (g[i][j] && g2[p[i]][p[j]]) return;
    tfl = 1;
    return;
  }
  for (int i = 1; i <= m; i++)
    if (!pvis[i]) {
      pvis[i] = 1;
      p[dep] = i;
      tdfs(dep + 1);
      if (tfl) return;
      pvis[i] = 0;
    }
}
void findlf(int fl, int &u, int &v, int &fu, int &fv) {
  int mx = 0, id = 0;
  for (int i = fl + 1; i <= fl + n; i++) {
    if (deg[i] > mx) {
      mx = deg[i];
      id = i;
    }
  }
  if (mx < m - 3) {
    for (int i = fl + 1; i <= fl + n; i++)
      if (!vis[i] && deg[i] == 1) {
        u = i;
        break;
      }
  } else {
    dfs(id, 0, 1);
    for (int i = fl + 1; i <= fl + n; i++)
      if (!vis[i] && deg[i] == 1 && d[i] == 2) {
        u = i;
        break;
      }
  }
  dfs(u, 0, 1);
  for (int i = fl + 1; i <= fl + n; i++) {
    if (!vis[i] && deg[i] == 1 && d[i] > 3) v = i;
    if (!vis[i] && d[i] == 2) fu = i;
  }
  for (int i = h[v]; i; i = e[i].nxt) {
    int nw = e[i].v;
    if (vis[nw]) continue;
    fv = nw;
  }
}
void solve() {
  if (m <= 7) {
    at = bt = 0;
    for (int i = 1; i <= n; i++)
      if (!vis[i]) a[++at] = i;
    for (int i = 1; i <= at; i++) {
      int u = a[i];
      for (int j = h[u]; j; j = e[j].nxt) {
        int v = e[j].v;
        if (vis[v]) continue;
        for (int k = 1; k <= at; k++)
          if (v == a[k]) g[i][k] = 1;
      }
    }
    for (int i = n + 1; i <= 2 * n; i++)
      if (!vis[i]) b[++bt] = i;
    for (int i = 1; i <= bt; i++) {
      int u = b[i];
      for (int j = h[u]; j; j = e[j].nxt) {
        int v = e[j].v;
        if (vis[v]) continue;
        for (int k = 1; k <= bt; k++)
          if (v == b[k]) g2[i][k] = 1;
      }
    }
    tdfs(1);
    for (int i = 1; i <= at; i++) link(a[i], b[p[i]]);
    return;
  }
  int id = 0;
  for (int i = 1; i <= 2 * n; i++) {
    if (vis[i]) continue;
    if (deg[i] == m - 2) id = i;
  }
  if (id) {
    int fl = 0;
    dfs(id, 0, 1);
    if (id > n) fl += n;
    int u = 0, v = 0;
    for (int i = fl + 1; i <= fl + n; i++) {
      if (vis[i]) continue;
      if (d[i] == 3) u = i;
    }
    for (int i = h[u]; i; i = e[i].nxt) {
      int nw = e[i].v;
      if (vis[nw]) continue;
      v = nw;
    }
    int id2 = 0, u2 = 0, v2 = 0;
    if (fl == 0)
      fl = n;
    else
      fl = 0;
    for (int i = fl + 1; i <= fl + n; i++)
      if (!vis[i] && deg[i] == 1) {
        id2 = i;
        break;
      }
    for (int i = h[id2]; i; i = e[i].nxt) {
      int nw = e[i].v;
      if (vis[nw]) continue;
      u2 = nw;
    }
    vis2[u2] = 1;
    for (int i = h[u2]; i; i = e[i].nxt) {
      int nw = e[i].v;
      if (vis[nw]) continue;
      vis2[nw] = 1;
    }
    for (int i = fl + 1; i <= fl + n; i++)
      if (!vis[i] && !vis2[i]) v2 = i;
    if (u < u2)
      link(u, u2), link(v, v2), link(id, id2);
    else
      link(u2, u), link(v2, v), link(id2, id);
    at = bt = 0;
    for (int i = 1; i <= n; i++)
      if (!vis[i]) a[++at] = i;
    for (int i = n + 1; i <= 2 * n; i++)
      if (!vis[i]) b[++bt] = i;
    for (int i = 1; i <= at; i++) link(a[i], b[i]);
    return;
  }
  if (!id) {
    int u = 0, v = 0, fu, fv, u2 = 0, v2 = 0, fu2, fv2;
    findlf(0, u, v, fu, fv);
    findlf(n, u2, v2, fu2, fv2);
    vis[u] = vis[v] = vis[u2] = vis[v2] = 1;
    m -= 2;
    deg[fu]--, deg[fv]--, deg[fu2]--, deg[fv2]--;
    solve();
    if (tans[fu] == fu2 || tans[fv] == fv2)
      link(u, v2), link(v, u2);
    else
      link(u, u2), link(v, v2);
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= 2 * n - 2; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    add(u, v);
    add(v, u);
    deg[u]++, deg[v]++;
  }
  for (int i = 1; i <= 2 * n; i++)
    if (deg[i] == n - 1) {
      printf("No\n");
      return 0;
    }
  m = n;
  solve();
  printf("Yes\n");
  for (int i = 1; i <= n; i++) printf("%d ", tans[i]);
  return 0;
}