#include <bits/stdc++.h>
using namespace std;
long long read() {
  long long a = 0, b = 1;
  char c = getchar();
  while (c > '9' || c < '0') {
    if (c == '-') b = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') a = a * 10 + c - 48, c = getchar();
  return a * b;
}
string a;
int ck() {
  int ct = 0;
  for (auto i : a)
    if (i == 'a' || i == 'e' || i == 'o' || i == 'u' || i == 'i') ct++;
  return ct;
}
int main() {
  getline(cin, a);
  if (ck() != 5) return puts("NO"), 0;
  getline(cin, a);
  if (ck() != 7) return puts("NO"), 0;
  getline(cin, a);
  if (ck() != 5) return puts("NO"), 0;
  puts("YES");
  return 0;
}
