#include <bits/stdc++.h>
using namespace std;
vector<int> g[33];
pair<long long, long long> p[33];
void dfs(int u, int fa, int state, long long d) {
  int idx = 0;
  for (int i = 0; i < (int)g[u].size(); ++i) {
    int v = g[u][i];
    if (v == fa) continue;
    while ((state >> idx) & 1) ++idx;
    if (idx == 0)
      p[v] = make_pair(p[u].first, p[u].second - d);
    else if (idx == 1)
      p[v] = make_pair(p[u].first + d, p[u].second);
    else if (idx == 2)
      p[v] = make_pair(p[u].first - d, p[u].second);
    else
      p[v] = make_pair(p[u].first, p[u].second + d);
    dfs(v, u, 1 << (3 - idx), d / 2);
    ++idx;
  }
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n - 1; ++i) {
    int u, v;
    scanf("%d%d", &u, &v);
    g[u].push_back(v);
    g[v].push_back(u);
  }
  for (int i = 1; i <= n; ++i)
    if ((int)g[i].size() > 4) return puts("NO"), 0;
  puts("YES");
  p[1] = make_pair(0, 0);
  dfs(1, -1, 0, 1LL << n);
  for (int i = 1; i <= n; ++i) printf("%lld %lld\n", p[i].first, p[i].second);
  return 0;
}
