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