#include <bits/stdc++.h>
long long a, s, d, f, g, h, j, k, l;
long long z[1000001];
using namespace std;
int main() {
  string q;
  s = 0;
  getline(cin, q);
  f = 0;
  for (d = 0; d < q.length(); d++) {
    if (q[d] == 'a' || q[d] == 'e' || q[d] == 'i' || q[d] == 'o' || q[d] == 'u')
      f++;
  }
  if (f != 5) s++;
  getline(cin, q);
  f = 0;
  for (d = 0; d < q.length(); d++) {
    if (q[d] == 'a' || q[d] == 'e' || q[d] == 'i' || q[d] == 'o' || q[d] == 'u')
      f++;
  }
  if (f != 7) s++;
  getline(cin, q);
  f = 0;
  for (d = 0; d < q.length(); d++) {
    if (q[d] == 'a' || q[d] == 'e' || q[d] == 'i' || q[d] == 'o' || q[d] == 'u')
      f++;
  }
  if (f != 5) s++;
  if (s == 0)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
