#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int N = 30;
int n, pw[N];
vector<int> g[N];
bool occ[N][4];
constexpr int xx[]{1, 0, -1, 0}, yy[]{0, 1, 0, -1};
pair<int, int> ans[N];
int dfs(int v, int p = -1, int x = 0, int y = 0, int s = 1 << 30) {
  ans[v] = {x, y};
  int cd = 0;
  for (int t : g[v]) {
    if (t != p) {
      while (occ[v][cd]) ++cd;
      occ[v][cd] = occ[t][cd ^ 2] = true;
      dfs(t, v, x + s * xx[cd], y + s * yy[cd], s / 2);
    }
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  for (int i = 1; i < n; ++i) {
    int a, b;
    cin >> a >> b;
    --a;
    --b;
    ++pw[a];
    ++pw[b];
    if (max(pw[a], pw[b]) > 4) return cout << "NO", 0;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  dfs(0);
  cout << "YES\n";
  for (int i = 0; i < n; ++i) {
    cout << ans[i].first << ' ' << ans[i].second << '\n';
  }
}
