#include <bits/stdc++.h>
int countvol(char string[]);
int main() {
  char str[101];
  gets(str);
  if (countvol(str) == 5) {
    gets(str);
    if (countvol(str) == 7) {
      gets(str);
      if (countvol(str) == 5)
        printf("YES ");
      else
        printf("NO ");
    } else
      printf("NO ");
  } else
    printf("NO ");
  return 0;
}
int countvol(char str[]) {
  int i, j = 0;
  for (i = 0; str[i]; ++i) {
    switch (str[i]) {
      case 'a':
      case 'e':
      case 'i':
      case 'o':
      case 'u':
        ++j;
    }
  }
  return j;
}
