#include <bits/stdc++.h>
using namespace std;
struct Node {
  long long x;
  long long y;
  int dir;
} point[110];
int xx[] = {1, 0, -1, 0};
int yy[] = {0, 1, 0, -1};
bool visit[110];
vector<long long> vec[110];
void DFS(long long n, long long len) {
  visit[n] = true;
  bool vis[10];
  memset(vis, false, sizeof(vis));
  for (int i = 0; i < vec[n].size(); ++i) {
    if (!visit[vec[n][i]]) {
      visit[vec[n][i]] = true;
      for (int j = 0; j < 4; ++j) {
        if ((j + 2) % 4 != point[n].dir && !vis[j]) {
          vis[j] = true;
          point[vec[n][i]] =
              Node{point[n].x + xx[j] * len, point[n].y + yy[j] * len, j};
          DFS(vec[n][i], len / 2 - 1);
          break;
        }
      }
    }
  }
}
int main() {
  long long n;
  while (cin >> n) {
    memset(vec, 0, sizeof(vec));
    memset(point, -1, sizeof(point));
    memset(visit, false, sizeof(visit));
    long long x, y;
    for (int i = 1; i < n; ++i) {
      cin >> x >> y;
      vec[x].push_back(y);
      vec[y].push_back(x);
    }
    bool flag = true;
    for (int i = 1; i <= n; ++i)
      if (vec[i].size() > 4) {
        flag = false;
        break;
      }
    if (flag) {
      cout << "YES\n";
      DFS(1, 10000000000000000);
      for (int i = 1; i <= n; ++i)
        cout << point[i].x << " " << point[i].y << endl;
    } else
      cout << "NO\n";
  }
  return 0;
}
