#include <bits/stdc++.h>
using namespace std;
const int maxn = 32;
int n, m;
int deg[maxn];
bool g[maxn][maxn];
bool vis[maxn][4];
bool placed[maxn];
pair<long long, long long> p[maxn];
void dfs(int i, long long len) {
  placed[i] = true;
  for (int j = 1; j <= n; ++j)
    if (!placed[j] && g[i][j]) {
      if (!vis[i][0]) {
        vis[i][0] = vis[j][2] = true;
        p[j] = {p[i].first + len, p[i].second};
        dfs(j, len >> 1);
      } else if (!vis[i][1]) {
        vis[i][1] = vis[j][3] = true;
        p[j] = {p[i].first, p[i].second + len};
        dfs(j, len >> 1);
      } else if (!vis[i][2]) {
        vis[i][2] = vis[j][0] = true;
        p[j] = {p[i].first - len, p[i].second};
        dfs(j, len >> 1);
      } else if (!vis[i][3]) {
        vis[i][3] = vis[j][1] = true;
        p[j] = {p[i].first, p[i].second - len};
        dfs(j, len >> 1);
      } else
        puts("WTF???");
    }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i < n; ++i) {
    int u, v;
    scanf("%d%d", &u, &v);
    if (++deg[u] > 4) return puts("NO"), 0;
    if (++deg[v] > 4) return puts("NO"), 0;
    g[u][v] = g[v][u] = true;
  }
  p[1] = {0, 0};
  dfs(1, 1ll << 58);
  puts("YES");
  for (int i = 1; i <= n; ++i) printf("%lld %lld\n", p[i].first, p[i].second);
  return 0;
}
