#include <bits/stdc++.h>
using namespace std;
void solve() {
  string s;
  getline(cin, s);
  int cnt = 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')
      cnt++;
  }
  if (cnt != 5) {
    cout << "NO"
         << "\n";
    return;
  }
  cnt = 0;
  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')
      cnt++;
  }
  if (cnt != 7) {
    cout << "NO"
         << "\n";
    return;
  }
  cnt = 0;
  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')
      cnt++;
  }
  if (cnt != 5) {
    cout << "NO"
         << "\n";
    return;
  }
  cout << "YES"
       << "\n";
}
void doper() {}
int main() {
  doper();
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int t = 1;
  while (t--) solve();
  return 0;
}
