#include <bits/stdc++.h>
int main() {
  char a[101];
  char b[101];
  char c[101];
  gets(a);
  gets(b);
  gets(c);
  int l1 = strlen(a);
  int l2 = strlen(b);
  int l3 = strlen(c);
  int i, d = 0, e = 0, f = 0;
  for (i = 0; i < l1; i++) {
    if (a[i] == 'a' || a[i] == 'e' || a[i] == 'i' || a[i] == 'o' || a[i] == 'u')
      d++;
  }
  for (i = 0; i < l2; i++) {
    if (b[i] == 'a' || b[i] == 'e' || b[i] == 'i' || b[i] == 'o' || b[i] == 'u')
      e++;
  }
  for (i = 0; i < l3; i++) {
    if (c[i] == 'a' || c[i] == 'e' || c[i] == 'i' || c[i] == 'o' || c[i] == 'u')
      f++;
  }
  if (d == 5 && e == 7 && f == 5) {
    printf("YES");
  } else {
    printf("NO");
  }
  return 0;
}
