#include <bits/stdc++.h>
using namespace std;
int p[] = {0, 5, 7, 5};
int main() {
  for (int k = 1; k <= 3; k++) {
    string s;
    getline(cin, s);
    int tot = 0;
    for (int i = 0; i < s.size(); i++)
      if (s[i] == 'a' || s[i] == 'e' || s[i] == 'i' || s[i] == 'o' ||
          s[i] == 'u')
        tot++;
    if (tot != p[k]) {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
  return 0;
}
