#include <bits/stdc++.h>
using namespace std;
int ara[5];
int main() {
  string x;
  for (int i = 0; i < 3; i++) {
    getline(cin, x);
    int len = x.size();
    int cnt = 0;
    for (int i = 0; i < len; i++) {
      if (x[i] == 'a' || x[i] == 'e' || x[i] == 'i' || x[i] == 'o' ||
          x[i] == 'u')
        cnt++;
    }
    ara[i] = cnt;
  }
  if (ara[0] == 5 && ara[1] == 7 && ara[2] == 5)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
