#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios::sync_with_stdio(false);
  for (int i = 0; i < 3; i++) {
    string s;
    getline(cin, s);
    int cter = 0;
    for (int j = 0; j < s.size(); j++) {
      if (s[j] == 'a' || s[j] == 'e' || s[j] == 'u' || s[j] == 'o' ||
          s[j] == 'i')
        cter++;
    }
    if (i % 2 == 0) {
      if (cter != 5) {
        cout << "NO" << endl;
        return 0;
      }
    } else {
      if (cter != 7) {
        cout << "NO" << endl;
        return 0;
      }
    }
  }
  cout << "YES" << endl;
  return 0;
}
