#include <bits/stdc++.h>
using namespace std;
vector<int> edge[32];
vector<int> son[32];
int dx[4] = {1, -1, 0, 0};
int dy[4] = {0, 0, 1, -1};
bool chk[32];
bool cant;
pair<long long, long long> ans[33];
void dfs(int u) {
  chk[u] = true;
  for (int i = 0; i < edge[u].size(); i++) {
    int v = edge[u][i];
    if (chk[v]) continue;
    son[u].push_back(v);
    dfs(v);
  }
}
void findcoord(int u, long long pp, long long x, long long y, int pos) {
  bool chkd[4] = {false, false, false, false};
  if (pos != -1) chkd[pos ^ 1] = true;
  ans[u].first = x;
  ans[u].second = y;
  if (u == 1 && son[u].size() > 4) {
    cant = true;
    return;
  } else if (u != 1 && son[u].size() > 3) {
    cant = true;
    return;
  }
  for (int i = 0; i < son[u].size(); i++) {
    int v = son[u][i];
    for (int j = 0; j < 4; j++) {
      if (chkd[j]) continue;
      chkd[j] = true;
      findcoord(v, pp >> 1, x + pp * dx[j], y + pp * dy[j], j);
      break;
    }
  }
}
int main() {
  int i, n;
  int x, y;
  scanf("%d", &n);
  for (i = 0; i < n - 1; i++) {
    scanf("%d %d", &x, &y);
    edge[x].push_back(y);
    edge[y].push_back(x);
  }
  dfs(1);
  cant = false;
  findcoord(1, (long long)1 << 40, 0, 0, -1);
  if (cant)
    printf("NO\n");
  else {
    printf("YES\n");
    for (i = 1; i <= n; i++) printf("%lld %lld\n", ans[i].first, ans[i].second);
  }
  return 0;
}
