#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void checkmin(T &a, T b) {
  if (a > b) a = b;
}
template <class T>
inline void checkmax(T &a, T b) {
  if (a < b) a = b;
}
const int oo = 1 << 30;
const double eps = 1e-7;
const int N = 1;
const int M = 1;
const long long P = 10000000097ll;
char o[8] = "aeiou";
int def(char *s) {
  int sn, i, j, k;
  int ans = 0;
  sn = strlen(s);
  for ((i) = 0; i < (sn); (i)++) {
    for ((j) = 0; j < (5); (j)++)
      if (s[i] == o[j]) ans++;
  }
  return ans;
}
int main() {
  int T, _ = 0;
  char s[1288];
  gets(s);
  if (def(s) != 5) goto end;
  gets(s);
  if (def(s) != 7) goto end;
  gets(s);
  if (def(s) != 5) goto end;
  puts("YES");
  return 0;
end:
  puts("NO");
  return 0;
}
