#include <bits/stdc++.h>
using namespace std;
int a[9];
string q, t, s;
int main() {
  getline(cin, s);
  getline(cin, t);
  getline(cin, q);
  for (int i = 0; i <= s.size() - 1; i++)
    if (s[i] == 'a' || s[i] == 'e' || s[i] == 'i' || s[i] == 'o' || s[i] == 'u')
      a[1]++;
  for (int i = 0; i <= t.size() - 1; i++)
    if (t[i] == 'a' || t[i] == 'e' || t[i] == 'i' || t[i] == 'o' || t[i] == 'u')
      a[2]++;
  for (int i = 0; i <= q.size() - 1; i++)
    if (q[i] == 'a' || q[i] == 'e' || q[i] == 'i' || q[i] == 'o' || q[i] == 'u')
      a[3]++;
  if (a[1] == 5 && a[2] == 7 && a[3] == 5)
    cout << "YES";
  else
    cout << "NO";
  fclose(stdin);
  fclose(stdout);
  return 0;
}
