#include <bits/stdc++.h>
using namespace std;
int main() {
  int a = 0, b = 0, c = 0;
  string s, s1, s2;
  getline(cin, s);
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == 'a' || s[i] == 'e' || s[i] == 'i' || s[i] == 'o' || s[i] == 'u')
      a++;
  }
  getline(cin, s1);
  for (int i = 0; i < s1.size(); i++) {
    if (s1[i] == 'a' || s1[i] == 'e' || s1[i] == 'i' || s1[i] == 'o' ||
        s1[i] == 'u')
      b++;
  }
  getline(cin, s2);
  for (int i = 0; i < s2.size(); i++) {
    if (s2[i] == 'a' || s2[i] == 'e' || s2[i] == 'i' || s2[i] == 'o' ||
        s2[i] == 'u')
      c++;
  }
  if (a == 5 && b == 7 && c == 5)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}
