#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  string v = "aeiou";
  int res[] = {5, 7, 5};
  bool val = 1;
  for (int i = 0; i < 3; ++i) {
    getline(cin, s);
    int cnt = 0;
    for (int j = 0; j < s.size(); ++j) {
      cnt += (v.find(s[j]) != -1);
    }
    if (cnt != res[i]) {
      val = 0;
    }
  }
  if (val)
    cout << "YES\n";
  else
    cout << "NO\n";
  return 0;
}
