#include <bits/stdc++.h>
using namespace std;
int dir[4][2] = {{1, 0}, {0, 1}, {0, -1}, {-1, 0}};
int n;
int rudu[35];
int x[35], y[35];
int tem1, tem2;
vector<int> ver[35];
bool vi[35];
void dfs(int num, int xx, int yy, int len, int from) {
  vi[num] = true;
  x[num] = xx;
  y[num] = yy;
  int i;
  int j = 0;
  for (i = 0; i < ver[num].size(); i++) {
    if (vi[ver[num][i]] == true) continue;
    if (j + from == 3) j++;
    dfs(ver[num][i], xx + dir[j][0] * len, yy + dir[j][1] * len, len / 2, j);
    j++;
  }
}
int main() {
  scanf("%d", &n);
  int i;
  for (i = 0; i < n - 1; i++) {
    scanf("%d %d", &tem1, &tem2);
    ver[tem1].push_back(tem2);
    ver[tem2].push_back(tem1);
    rudu[tem1]++;
    rudu[tem2]++;
  }
  for (i = 1; i <= n; i++) {
    if (rudu[i] > 4) {
      printf("NO\n");
      return 0;
    }
  }
  memset(vi, false, sizeof(vi));
  dfs(1, 0, 0, 1 << 30, -1);
  printf("YES\n");
  for (i = 1; i <= n; i++) {
    printf("%d %d\n", x[i], y[i]);
  }
  return 0;
}
