#include <bits/stdc++.h>
using namespace std;
vector<int> ln[40];
bool positioned[40];
pair<long long, long long> pos[40];
int par[40];
bool U[40];
bool D[40];
bool L[40];
bool R[40];
long long E[40];
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    ln[a].push_back(b);
    ln[b].push_back(a);
  }
  int root = 0;
  for (int i = 0; i < n; i++) {
    if (ln[i].size() > ln[root].size()) root = i;
  }
  queue<int> q;
  positioned[root] = true;
  pos[root] = {0, 0};
  E[root] = 1ll << 31;
  for (auto e : ln[root]) q.push(e), par[e] = root;
  while (!q.empty()) {
    int v = q.front();
    q.pop();
    int p = par[v];
    long long el = E[p];
    if (R[p] == false) {
      pos[v] = {pos[p].first + el, pos[p].second};
      E[v] = el / 2;
      L[v] = true;
      R[p] = true;
      positioned[v] = true;
      for (auto e : ln[v])
        if (!positioned[e]) par[e] = v, q.push(e);
    } else if (L[p] == false) {
      pos[v] = {pos[p].first - el, pos[p].second};
      E[v] = el / 2;
      R[v] = true;
      L[p] = true;
      positioned[v] = true;
      for (auto e : ln[v])
        if (!positioned[e]) par[e] = v, q.push(e);
    } else if (U[p] == false) {
      pos[v] = {pos[p].first, pos[p].second + el};
      E[v] = el / 2;
      D[v] = true;
      U[p] = true;
      positioned[v] = true;
      for (auto e : ln[v])
        if (!positioned[e]) par[e] = v, q.push(e);
    } else if (D[p] == false) {
      pos[v] = {pos[p].first, pos[p].second - el};
      E[v] = el / 2;
      U[v] = true;
      D[p] = true;
      positioned[v] = true;
      for (auto e : ln[v])
        if (!positioned[e]) par[e] = v, q.push(e);
    } else {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES\n";
  for (int i = 0; i < n; i++) {
    cout << pos[i].first << ' ' << pos[i].second << endl;
  }
  return 0;
}
