#include <bits/stdc++.h>
using namespace std;
char lyrics[203], corrected[203];
int main() {
  string first, second, third;
  getline(cin, first);
  getline(cin, second);
  getline(cin, third);
  int f, s, t, i;
  f = s = t = 0;
  for (i = 0; first[i]; i++)
    if (first[i] == 'a' or first[i] == 'e' or first[i] == 'i' or
        first[i] == 'o' or first[i] == 'u')
      f++;
  for (i = 0; second[i]; i++)
    if (second[i] == 'a' or second[i] == 'e' or second[i] == 'i' or
        second[i] == 'o' or second[i] == 'u')
      s++;
  for (i = 0; third[i]; i++)
    if (third[i] == 'a' or third[i] == 'e' or third[i] == 'i' or
        third[i] == 'o' or third[i] == 'u')
      t++;
  if (f == 5 and s == 7 and t == 5)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
