#include <bits/stdc++.h>
using namespace std;
int deg[40];
int ansX[40], ansY[40];
int siz[40];
vector<int> tree[40];
int dx[] = {-1, 0, 0, 1};
int dy[] = {0, 1, -1, 0};
void dfs(int cur, int fa) {
  siz[cur] = 1;
  for (auto o : tree[cur])
    if (o != fa) dfs(o, cur), siz[cur] += siz[o];
}
void dfs(int cur, int fa, int x, int y, int dir) {
  ansX[cur] = x;
  ansY[cur] = y;
  int d = 0;
  for (auto o : tree[cur])
    if (o != fa) {
      if (d + dir == 3) d++;
      dfs(o, cur, x + dx[d] * siz[o], y + dy[d] * siz[o], d);
      d++;
    }
}
int main() {
  int n, u, v;
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    scanf("%d%d", &u, &v);
    deg[u]++, deg[v]++;
    tree[u].push_back(v);
    tree[v].push_back(u);
  }
  int ok = true;
  for (int i = 1; i <= n; i++) ok &= deg[i] <= 4;
  if (!ok)
    puts("NO");
  else {
    puts("YES");
    dfs(1, 0);
    dfs(1, 0, 0, 0, -1);
    for (int i = 1; i <= n; i++) printf("%d %d\n", ansX[i], ansY[i]);
  }
  return 0;
}
