#include <bits/stdc++.h>
using namespace std;
long long dx[4] = {0, 1, 0, -1};
long long dy[4] = {1, 0, -1, 0};
const long long N = 50;
vector<long long> adj[N];
vector<pair<long long, long long> > ans(N);
long long visited[N];
void dfs(long long v, long long x, long long y, long long d, long long f) {
  d = (d + 3) % 4;
  visited[v] = 1;
  ans[v].first = x, ans[v].second = y;
  for (long long k : adj[v]) {
    if (!visited[k]) {
      dfs(k, x + dx[d] * f, y + dy[d] * f, d, f / 2);
      d = (d + 1) % 4;
    }
  }
}
int32_t main() {
  long long n, a, b;
  cin >> n;
  long long ex = 0;
  for (long long i = 0; i < n - 1; i++) {
    cin >> a >> b;
    adj[a].push_back(b);
    adj[b].push_back(a);
    ex = max((long long)adj[a].size(), max(ex, (long long)adj[b].size()));
  }
  if (ex > 4) return cout << "NO\n", 0;
  dfs(1, 0, 0, 0, 1LL << 40);
  cout << "YES\n";
  for (long long i = 1; i <= n; i++)
    cout << ans[i].first << " " << ans[i].second << endl;
}
