#include <bits/stdc++.h>
int main() {
  char a[200];
  int sum1 = 0, sum2 = 0, sum3 = 0;
  for (int i = 0; i < 3; i++) {
    gets(a);
    for (int j = 0; j < strlen(a); j++)
      if (a[j] == 'a' || a[j] == 'e' || a[j] == 'i' || a[j] == 'o' ||
          a[j] == 'u') {
        if (i == 0) sum1++;
        if (i == 1) sum2++;
        if (i == 2) sum3++;
      }
  }
  if (sum1 == 5 && sum2 == 7 && sum3 == 5)
    printf("YES\n");
  else
    printf("NO\n");
  return 0;
}
