#include <bits/stdc++.h>
int main() {
  char s1[101], s2[101], s3[101];
  gets(s1);
  gets(s2);
  gets(s3);
  int i, egsh = 0, t = 0;
  for (i = 0; i < strlen(s1); i++) {
    if ((s1[i] == 'a') || (s1[i] == 'e') || (s1[i] == 'i') || (s1[i] == 'o') ||
        (s1[i] == 'u')) {
      egsh++;
    }
  }
  if (egsh == 5) t++;
  egsh = 0;
  for (i = 0; i < strlen(s2); i++) {
    if ((s2[i] == 'a') || (s2[i] == 'e') || (s2[i] == 'i') || (s2[i] == 'o') ||
        (s2[i] == 'u'))
      egsh++;
  }
  if (egsh == 7) t++;
  egsh = 0;
  for (i = 0; i < strlen(s3); i++) {
    if ((s3[i] == 'a') || (s3[i] == 'e') || (s3[i] == 'i') || (s3[i] == 'o') ||
        (s3[i] == 'u'))
      egsh++;
  }
  if (egsh == 5) t++;
  if (t >= 3)
    printf("YES");
  else
    printf("NO");
  return 0;
}
