#include <bits/stdc++.h>
using namespace std;
const int MOD = 998244353;
vector<int> G[51];
map<pair<long long, long long>, bool> taken;
int xFactor[4] = {0, 1, 0, -1};
int yFactor[4] = {1, 0, -1, 0};
pair<long long, long long> saved[51];
void savePosition(int node, long long x, long long y, long long offset,
                  int parent, int from) {
  saved[node] = {x, y};
  taken[{x, y}] = true;
  int cur = 0;
  for (int i = 0; i < G[node].size(); i++) {
    if (G[node][i] == parent) continue;
    if ((cur + 2) % 4 == from) cur++;
    do {
      offset /= 2;
    } while (taken[{x + offset * xFactor[cur], y + offset * yFactor[cur]}] ==
             true);
    savePosition(G[node][i], x + offset * xFactor[cur],
                 y + offset * yFactor[cur], offset, node, cur);
    cur++;
  }
}
int main() {
  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);
    if (G[x].size() > 4 || G[y].size() > 4) {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
  savePosition(1, 0, 0, 100000000000000000, -1, -1);
  for (int i = 1; i <= n; i++) {
    cout << saved[i].first << " " << saved[i].second << endl;
  }
}
