#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, coun = 0, flag = 0;
  string fst, sec, thr;
  getline(cin, fst);
  for (i = 0; i < fst.size(); i++) {
    if (fst[i] == 'a' || fst[i] == 'e' || fst[i] == 'i' || fst[i] == 'o' ||
        fst[i] == 'u') {
      coun++;
    }
  }
  if (coun != 5) flag = 1;
  coun = 0;
  getline(cin, sec);
  for (i = 0; i < sec.size(); i++) {
    if (sec[i] == 'a' || sec[i] == 'e' || sec[i] == 'i' || sec[i] == 'o' ||
        sec[i] == 'u') {
      coun++;
    }
  }
  if (coun != 7) flag = 1;
  coun = 0;
  getline(cin, thr);
  for (i = 0; i < thr.size(); i++) {
    if (thr[i] == 'a' || thr[i] == 'e' || thr[i] == 'i' || thr[i] == 'o' ||
        thr[i] == 'u') {
      coun++;
    }
  }
  if (coun != 5) flag = 1;
  if (flag == 0)
    cout << "YES" << '\n';
  else
    cout << "NO" << '\n';
}
