#include <bits/stdc++.h>
char example[] = {'a', 'e', 'i', 'o', 'u'};
char a[1002];
int main(void) {
  int i, j;
  int num1, num2, num3;
  while (fgets(a, 1002, stdin) != NULL) {
    num1 = 0;
    num2 = 0;
    num3 = 0;
    for (i = 0; a[i] != 10; i++)
      for (j = 0; j < 5; j++) {
        if (a[i] == example[j]) num1++;
      }
    fgets(a, 1002, stdin);
    for (i = 0; a[i] != 10; i++)
      for (j = 0; j < 5; j++) {
        if (a[i] == example[j]) num2++;
      }
    fgets(a, 1002, stdin);
    for (i = 0; a[i] != 10; i++)
      for (j = 0; j < 5; j++) {
        if (a[i] == example[j]) num3++;
      }
    if (num1 == 5 && num2 == 7 && num3 == 5)
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
