#include <bits/stdc++.h>
using namespace std;
vector<int> g[55];
int n;
long long ansx[55], ansy[55];
long long fx[] = {1, -1, 0, 0};
long long fy[] = {0, 0, 1, -1};
void dfs(int u, int fa, long long cnt, int pos) {
  if (u == 1) {
    ansx[u] = ansy[u] = 0;
    for (int i = 0; i < g[u].size(); i++) {
      int v = g[u][i];
      ansx[v] = fx[i] * cnt + ansx[u];
      ansy[v] = fy[i] * cnt + ansy[u];
      dfs(v, u, cnt / 2, i);
    }
  } else {
    for (int i = 0, j = 0; i < g[u].size(); i++) {
      int v = g[u][i];
      if (v == fa) continue;
      if (pos == 0 && j == 1) j++;
      if (pos == 1 && j == 0) j++;
      if (pos == 2 && j == 3) j++;
      if (pos == 3 && j == 2) j++;
      ansx[v] = fx[j] * cnt + ansx[u];
      ansy[v] = fy[j] * cnt + ansy[u];
      dfs(v, u, cnt / 2, j);
      j++;
    }
  }
}
int main() {
  while (cin >> n) {
    for (int i = 0; i < n; i++) {
      g[i].clear();
    }
    int flag = 0;
    for (int i = 1; i < n; i++) {
      int u, v;
      cin >> u >> v;
      g[u].push_back(v);
      g[v].push_back(u);
      if (g[u].size() > 4) flag = 1;
      if (g[v].size() > 4) flag = 1;
    }
    if (flag) {
      cout << "NO" << endl;
    } else {
      dfs(1, 0, 1e17, 0);
      cout << "YES" << endl;
      for (int i = 1; i <= n; i++) {
        cout << ansx[i] << " " << ansy[i] << endl;
      }
    }
  }
  return 0;
}
