#include <bits/stdc++.h>
using namespace std;
bool vowel(int vw) {
  return (vw == 'a' || vw == 'o' || vw == 'i' || vw == 'u' || vw == 'e');
}
int main() {
  int v[] = {5, 7, 5};
  vector<string> s;
  string ss;
  for (int i = 0; i < 3; i++) {
    getline(cin >> ws, ss);
    s.push_back(ss);
  }
  for (int i = 0; i < 3; i++) {
    int c = 0;
    for (auto child : s[i]) {
      if (vowel(child)) c++;
    }
    if (c != v[i]) return cout << "NO\n", 0;
  }
  cout << "YES" << endl;
}
