#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  bool flag = 1;
  int c = 0, a[] = {5, 7, 5}, k = 0;
  map<char, bool> m{{'a', 1}, {'e', 1}, {'o', 1}, {'u', 1}, {'i', 1}};
  while (getline(cin, s)) {
    c = 0;
    for (int i = 0; i < s.size(); i++) c += m[s[i]];
    if (c != a[k]) flag = 0;
    k++;
  }
  if (flag == 1)
    cout << "YES";
  else
    cout << "NO";
}
