#include <bits/stdc++.h>
int main() {
  char s[101];
  int i, ct, h[] = {5, 7, 5};
  for (i = 0; i < 3; i++) {
    ct = 0;
    gets(s);
    for (int j = 0; s[j] != '\0'; j++) {
      if (s[j] == 'i' || s[j] == 'o' || s[j] == 'u' || s[j] == 'e' ||
          s[j] == 'a')
        ct++;
    }
    if (ct != h[i]) break;
  }
  printf("%s\n", i == 3 ? "YES" : "NO");
  return 0;
}
