#include <bits/stdc++.h>
using namespace std;
const int maxn = 100;
vector<int> G[maxn];
bool vis[maxn];
int x[maxn], y[maxn];
const int fx[4] = {0, 0, 1, -1};
const int fy[4] = {1, -1, 0, 0};
void dfs(int m, int x0, int y0, int l, int d) {
  int now = 0;
  if (now == d) now++;
  for (int i = 0; i < G[m].size(); i++) {
    int v = G[m][i];
    if (!vis[v]) {
      x[v] = x0 + fx[now] * l;
      y[v] = y0 + fy[now] * l;
      vis[v] = true;
      dfs(v, x[v], y[v], l / 2, now + (int)pow(-1, now % 2));
      now++;
      if (now == d) now++;
    }
  }
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n - 1; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    G[u].push_back(v);
    G[v].push_back(u);
  }
  for (int i = 1; i <= n; i++) {
    if (G[i].size() > 4) {
      printf("NO\n");
      return 0;
    }
  }
  x[1] = y[1] = 0;
  vis[1] = true;
  dfs(1, 0, 0, (1 << 30), -1);
  printf("YES\n");
  for (int i = 1; i <= n; i++) {
    printf("%d %d\n", x[i], y[i]);
  }
  return 0;
}
