#include <bits/stdc++.h>
using namespace std;
int f(const string& str) {
  int cnt = 0;
  for (int i = 0; i < str.length(); i++) {
    if (str[i] == 'a' || str[i] == 'e' || str[i] == 'i' || str[i] == 'o' ||
        str[i] == 'u') {
      cnt++;
    }
  }
  return cnt;
}
int main() {
  string a, b, c;
  getline(cin, a);
  getline(cin, b);
  getline(cin, c);
  if (f(a) == 5 && f(b) == 7 && f(c) == 5) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
}
