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