#include <bits/stdc++.h>
using namespace std;
int main() {
  string st1, st2, st3;
  char ch;
  while ((ch = getchar()) != '\n') st1 += ch;
  while ((ch = getchar()) != '\n') st2 += ch;
  while ((ch = getchar()) != '\n') st3 += ch;
  int a = 0, b = 0, c = 0;
  for (int i = 0; i < (int)st1.length(); ++i)
    if (st1[i] == 'a' || st1[i] == 'e' || st1[i] == 'i' || st1[i] == 'o' ||
        st1[i] == 'u')
      a++;
  for (int i = 0; i < (int)st2.length(); ++i)
    if (st2[i] == 'a' || st2[i] == 'e' || st2[i] == 'i' || st2[i] == 'o' ||
        st2[i] == 'u')
      b++;
  for (int i = 0; i < (int)st3.length(); ++i)
    if (st3[i] == 'a' || st3[i] == 'e' || st3[i] == 'i' || st3[i] == 'o' ||
        st3[i] == 'u')
      c++;
  if (a == 5 && b == 7 && c == 5)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
