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