#include <bits/stdc++.h>
using namespace std;
long long a[35][5], d[35], dx[5] = {0, 0, 1, 0, -1}, dy[5] = {0, 1, 0, -1, 0};
pair<long long, long long> p[35];
vector<long long> edge[35];
void dfs(long long u, long long fa, long long k) {
  long long now = 1;
  for (long long i = 0; i < edge[u].size(); i++) {
    long long v = edge[u][i];
    if (v == fa) continue;
    while (a[u][now]) now++;
    a[u][now] = 1;
    if (now == 1) a[v][3] = 1;
    if (now == 3) a[v][1] = 1;
    if (now == 2) a[v][4] = 1;
    if (now == 4) a[v][2] = 1;
    long long x = p[u].first + dx[now] * k, y = p[u].second + dy[now] * k;
    p[v] = {x, y};
    dfs(v, u, k / 2);
  }
}
int main() {
  long long n;
  cin >> n;
  for (long long i = 1; i < n; i++) {
    long long u, v;
    cin >> u >> v;
    edge[u].push_back(v);
    edge[v].push_back(u);
    d[u]++;
    d[v]++;
  }
  for (long long i = 1; i <= n; i++) {
    if (d[i] > 4) {
      cout << "NO" << endl;
      return 0;
    }
  }
  p[1] = {0, 0};
  dfs(1, 0, ((long long)1 << 31));
  cout << "YES" << endl;
  for (long long i = 1; i <= n; i++) {
    cout << p[i].first << " " << p[i].second << endl;
  }
}
