#include <bits/stdc++.h>
using namespace std;
template <class T>
bool umin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool umax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
pair<long long, long long> ans[100009];
vector<int> adj[100009];
int dx[] = {+1, 0, -1, 0};
int dy[] = {0, +1, 0, -1};
void dfs(int nd, int pr, int last, long long x, long long y, long long range) {
  ans[nd] = make_pair(x, y);
  int p = 0;
  for (int i = 0; i < int(adj[nd].size()); i++) {
    int to = adj[nd][i];
    if (to == pr) continue;
    if (p == (last + 2) % (5 - 1)) p++;
    long long tox = x + dx[p] * range;
    long long toy = y + dy[p] * range;
    dfs(to, nd, p, tox, toy, range / 2);
    p++;
  }
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  for (int i = 1; i <= n; i++)
    if (int(adj[i].size()) >= 5) {
      puts("NO");
      return 0;
    }
  dfs(1, -1, -1000000007, 0, 0, (1LL << 32));
  puts("YES");
  for (int i = 1; i <= n; i++)
    printf("%lld %lld\n", ans[i].first, ans[i].second);
  return 0;
}
