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