#include <bits/stdc++.h>
using namespace std;
const int N = 35;
vector<int> g[N];
pair<long long, long long> pt[N];
int n;
int dx[] = {0, 1, 0, -1};
int dy[] = {1, 0, -1, 0};
void rec(int x, long long sz, int xx, int dd, long long a, long long b) {
  pt[x] = {a, b};
  int d = 0;
  for (int y : g[x]) {
    if (y == xx) continue;
    if (d == dd) ++d;
    rec(y, (sz >> 1), x, (d + 2) % 4, a + sz * dx[d], b + sz * dy[d]);
    ++d;
  }
}
int main(void) {
  cin.tie(NULL);
  ios::sync_with_stdio(false);
  cin >> n;
  for (int i = 0; i < n - 1; ++i) {
    int u, v;
    cin >> u >> v;
    g[u - 1].push_back(v - 1);
    g[v - 1].push_back(u - 1);
  }
  for (int i = 0; i < n; ++i)
    if (g[i].size() > 4) {
      cout << "NO" << endl;
      return 0;
    }
  cout << "YES" << endl;
  rec(0, (1LL << 32), -1, -1, 0, 0);
  for (int i = 0; i < n; ++i)
    cout << pt[i].first << " " << pt[i].second << "\n";
  return 0;
}
