#include <bits/stdc++.h>
bool isvowel(char ch) {
  if (ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u' ||
      ch == 'A' || ch == 'E' || ch == 'I' || ch == 'O' || ch == 'U')
    return 1;
  return 0;
}
int main() {
  int i, j, k, l, n, count1, count2, count3;
  ;
  char s1[1000], s2[1000], s3[1000];
  while (gets(s1)) {
    gets(s2);
    gets(s3);
    count1 = count2 = count3 = 0;
    for (i = 0; s1[i]; i++) {
      if (isvowel(s1[i])) count1++;
    }
    for (i = 0; s2[i]; i++) {
      if (isvowel(s2[i])) count2++;
    }
    for (i = 0; s3[i]; i++) {
      if (isvowel(s3[i])) count3++;
    }
    if (count1 == 5 && count2 == 7 && count3 == 5)
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
