#include <bits/stdc++.h>
using namespace std;
int main() {
  string s1 = "ioaeu";
  string s2[3];
  for (int i = 0; i < 3; i++) getline(cin, s2[i]);
  for (int i = 0; i < 3; i++) {
    int cnt = 0;
    string str = s2[i];
    for (int j = 0; j < str.size(); j++) {
      for (int c = 0; c < 5; c++) {
        if (str[j] == s1[c]) cnt++;
      }
    }
    if (i == 0 && cnt != 5) {
      cout << "NO" << endl;
      return 0;
    } else if (i == 1 && cnt != 7) {
      cout << "NO" << endl;
      return 0;
    } else if (i == 2 && cnt != 5) {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
  return 0;
}
