#include <bits/stdc++.h>
using namespace std;
const int maxn = 35;
vector<int> g[maxn];
int n, du[maxn], X[maxn], Y[maxn];
bool vis[maxn];
void dfs(int u, int x, int y, int len, int dir) {
  int next[4][2] = {0, 1, 1, 0, 0, -1, -1, 0};
  dir = (dir + 3) % 4;
  for (int i = 0; i < g[u].size(); i++) {
    int v = g[u][i];
    if (!vis[v]) {
      vis[v] = 1;
      int tx = x + next[dir][0] * len;
      int ty = y + next[dir][1] * len;
      X[v] = tx, Y[v] = ty;
      dfs(v, tx, ty, len / 2, dir);
      dir = (dir + 1) % 4;
    }
  }
}
int main(void) {
  while (cin >> n) {
    memset(du, 0, sizeof(du));
    memset(vis, 0, sizeof(vis));
    for (int i = 0; i < maxn; i++) g[i].size();
    bool ok = 1;
    for (int i = 1; i < n; i++) {
      int u, v;
      scanf("%d%d", &u, &v);
      g[u].push_back(v);
      g[v].push_back(u);
      du[u]++, du[v]++;
      if (du[u] > 4 || du[v] > 4) ok = 0;
    }
    if (!ok)
      puts("NO");
    else {
      X[1] = Y[1] = 0;
      vis[1] = 1;
      dfs(1, 0, 0, 1 << 30, 0);
      puts("YES");
      for (int i = 1; i <= n; i++) printf("%d %d\n", X[i], Y[i]);
    }
  }
  return 0;
}
