#include <bits/stdc++.h>
using namespace std;
vector<int> g[50];
pair<int, int> cord[50];
int xx[] = {0, 1, 0, -1};
int yy[] = {1, 0, -1, 0};
bool vis[50];
void dfs(int u, int dir, int x, int y, int scale) {
  if (dir == 4) {
    cout << "NO";
    exit(0);
  }
  vis[u] = 1;
  cord[u] = make_pair(x, y);
  int next_dir = 0;
  for (int e = 0; e < g[u].size(); e++) {
    int v = g[u][e];
    if (vis[v]) continue;
    if (dir >= 0 && next_dir == (dir + 2) % 4) next_dir++;
    dfs(v, next_dir, x + xx[next_dir] * scale, y + yy[next_dir] * scale,
        scale >> 1);
    next_dir++;
  }
}
int main() {
  memset(vis, 0, sizeof vis);
  int n;
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    int x, y;
    cin >> x >> y;
    g[x].push_back(y);
    g[y].push_back(x);
  }
  dfs(1, -1, 0, 0, 1 << 30);
  cout << "YES\n";
  for (int i = 1; i <= n; i++)
    cout << cord[i].first << ' ' << cord[i].second << '\n';
}
