#include <bits/stdc++.h>
using namespace std;
int count(string s) {
  int x = 0;
  for (int i = 0; i < s.size(); i++) {
    switch (s[i]) {
      case 'a':
      case 'e':
      case 'i':
      case 'o':
      case 'u':
        x++;
        break;
    }
  }
  return x;
}
int main() {
  string L1, L2, L3;
  getline(cin, L1);
  getline(cin, L2);
  getline(cin, L3);
  if (count(L1) == 5 && count(L2) == 7 && count(L3) == 5)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}
