#include <bits/stdc++.h>
using namespace std;
char kata[110];
int main() {
  int jlh;
  bool mk;
  for (int i = 0; i < 3; i++) {
    mk = false;
    jlh = 0;
    fgets(kata, sizeof(kata), stdin);
    for (int j = 0; j < strlen(kata) - 1; j++) {
      if (kata[j] == 'a' || kata[j] == 'e' || kata[j] == 'i' ||
          kata[j] == 'o' || kata[j] == 'u')
        jlh++;
    }
    if ((i == 0 || i == 2) && jlh == 5)
      mk = true;
    else if (i == 1 && jlh == 7)
      mk = true;
    else
      break;
  }
  (mk) ? cout << "YES\n" : cout << "NO\n";
}
