#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
void c_p_c() {}
const long long Max = 1e7;
long long count(string s) {
  long long i;
  long long c = 0;
  for (i = 0; i < s.length(); i++) {
    if (s[i] == 'a' || s[i] == 'e' || s[i] == 'i' || s[i] == 'o' || s[i] == 'u')
      c++;
  }
  return c;
}
int32_t main() {
  c_p_c();
  string s;
  getline(cin, s);
  if (count(s) == 5)
    getline(cin, s);
  else {
    cout << "NO";
    return 0;
  }
  if (count(s) == 7)
    getline(cin, s);
  else {
    cout << "NO";
    return 0;
  }
  if (count(s) != 5)
    cout << "NO";
  else
    cout << "YES";
  return 0;
}
