#include <bits/stdc++.h>
using namespace std;
const int MAXN = 55;
vector<int> g[MAXN];
pair<long long, long long> ans[MAXN];
void dfs(int v, int parent, int direction, long long x, long long y,
         long long delta) {
  bool used[5];
  int dir;
  ans[v] = make_pair(x, y);
  memset(used, false, sizeof(used));
  if (direction != 0) {
    if (direction <= 2)
      direction += 2;
    else
      direction -= 2;
  }
  used[direction] = true;
  for (auto to : g[v]) {
    if (to == parent) continue;
    for (int i = 1; i < 5; i++) {
      if (!used[i]) {
        dir = i;
        break;
      }
    }
    used[dir] = true;
    if (dir == 1) {
      dfs(to, v, dir, x, y - delta, delta / 4);
    } else if (dir == 2) {
      dfs(to, v, dir, x + delta, y, delta / 4);
    } else if (dir == 3) {
      dfs(to, v, dir, x, y + delta, delta / 4);
    } else if (dir == 4) {
      dfs(to, v, dir, x - delta, y, delta / 4);
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  int n, a, b;
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    cin >> a >> b;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  for (int i = 1; i <= n; i++) {
    if (g[i].size() > 4) {
      cout << "NO" << endl;
      return 0;
    }
  }
  dfs(1, 0, 0, 0, 0, (long long)(288230376151711744));
  cout << "YES" << endl;
  for (int i = 1; i <= n; i++)
    cout << ans[i].first << " " << ans[i].second << endl;
  return 0;
}
