#include <bits/stdc++.h>
using namespace std;
int main() {
  string s, vow = "aeiou";
  int counter = 0;
  for (int l = 0; l < 3; l++) {
    getline(cin, s);
    for (int i = 0; i < s.size(); i++) {
      if (count(vow.begin(), vow.end(), s[i]) == 1) {
        counter++;
      }
    }
    if (l != 1 && counter != 5) {
      cout << "NO";
      return 0;
    } else if (l == 1 && counter != 7) {
      cout << "NO";
      return 0;
    }
    counter = 0;
  }
  cout << "YES";
  return 0;
}
