#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
const double sn = 1e-6;
int n;
vector<int> adj[35];
bool v[35];
int c[35];
pair<long long, long long> ans[35];
long long f = pow(2, 30);
void dfs(int i, long long x, long long y, long long x2, long long y2) {
  f /= 2;
  ans[i] = {x, y};
  v[i] = true;
  pair<long long, long long> arr[] = {
      {x + f, y}, {x - f, y}, {x, y + f}, {x, y - f}};
  int sz = adj[i].size();
  bool m[4] = {};
  for (int j = 0; j < sz; j++) {
    if (!v[adj[i][j]]) {
      for (int k = 0; k < 4; k++) {
        if (m[k]) continue;
        if (arr[k].first == x2 && !(x == 0 && y == 0)) {
          if ((arr[k].second < y && arr[k].second > y2) ||
              (arr[k].second > y && arr[k].second < y2))
            continue;
        } else if (arr[k].second == y2 && !(x == 0 && y == 0)) {
          if ((arr[k].first < x && arr[k].first > x2) ||
              (arr[k].first > x && arr[k].first < x2))
            continue;
        }
        m[k] = true;
        dfs(adj[i][j], arr[k].first, arr[k].second, x, y);
        break;
      }
    }
  }
}
int main() {
  scanf("%d", &n);
  bool v = true;
  for (int i = 0; i < n - 1; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    c[a]++;
    c[b]++;
    adj[b].push_back(a);
    adj[a].push_back(b);
    if (c[a] > 4 || c[b] > 4) v = false;
  }
  if (!v) {
    printf("NO\n");
    return 0;
  }
  dfs(1, 0, 0, 0, 0);
  printf("YES\n");
  for (int i = 1; i <= n; i++) {
    printf("%I64d %I64d\n", ans[i].first, ans[i].second);
  }
  return 0;
}
