#include <bits/stdc++.h>
using namespace std;
template <typename A, typename B>
ostream& operator<<(ostream& os, const pair<A, B>& p) {
  return os << '(' << p.first << ", " << p.second << ')';
}
template <typename C>
ostream& operator<<(ostream& os, const vector<C>& v) {
  for (__typeof((v).begin()) __it = (v).begin(); __it != (v).end(); __it++)
    os << *(__it) << ' ';
  return os;
}
const int inf = 0x3f3f3f3f;
const double eps = 1e-5;
int must[] = {5, 7, 5};
int main() {
  char s[234];
  for (int i = 0; i < 3; i++) {
    gets(s);
    int l = strlen(s);
    int cnt = 0;
    for (int j = 0; j < l; j++)
      if (s[j] == 'a' || s[j] == 'e' || s[j] == 'i' || s[j] == 'o' ||
          s[j] == 'u')
        cnt++;
    if (cnt != must[i]) {
      puts("NO");
      return 0;
    }
  }
  puts("YES");
  return 0;
}
