#include <bits/stdc++.h>
using namespace std;
int answer[3] = {5, 12, 17}, sum;
string s, vo = "aeiou";
int main() {
  for (int i = 0; i < 3; i++) {
    getline(cin, s);
    for (char c : s)
      for (char cc : vo) sum += (cc == c);
    if (sum != answer[i]) return cout << "NO\n", 0;
  }
  cout << "YES\n";
}
