#include <bits/stdc++.h>
int main() {
  int a, b, c, d, e, f;
  char ch, ch2;
  c = scanf("%d%d", &a, &b);
  d = scanf("%d%c%d%c", &e, &ch, &f, &ch2);
  printf("%d\n%d\n%d\n%d", c, d, e, f);
  if (d > 3 || d == 0) {
    printf("No");
  } else {
    int count1, count2;
    while (e > 0) {
      e = e / 10;
      count1 += 1;
    }
    while (f > 0) {
      f = f / 10;
      count2 += 1;
    }
    if (a == count1 && b == count2) {
      printf("Yes");
    } else {
      printf("No");
    }
  }
  return 0;
}
