#include <bits/stdc++.h>
using namespace std;
char str[105];
int main() {
  int jud = 1;
  for (int i = 0; i < 3; i++) {
    gets(str);
    int coun = 0;
    for (int j = 0; j < strlen(str); j++) {
      if (str[j] == 'a' || str[j] == 'e' || str[j] == 'i' || str[j] == 'o' ||
          str[j] == 'u')
        coun++;
    }
    if ((i == 0 || i == 2) && coun != 5) jud = 0;
    if (i == 1 && coun != 7) jud = 0;
  }
  if (jud == 1)
    printf("YES");
  else
    printf("NO");
  return 0;
}
