#include <bits/stdc++.h>
using namespace std;
int nv(string a) {
  map<char, int> mp;
  map<char, bool> mp1;
  int len = a.size();
  for (int i = 0; i < len; i++) {
    if (!mp1[a[i]]) {
      mp[a[i]]++;
    } else {
      mp[a[i]] = 1;
    }
  }
  return mp['a'] + mp['e'] + mp['i'] + mp['o'] + mp['u'];
}
int main() {
  string a, b, c, rpta = "NO";
  getline(cin, a);
  getline(cin, b);
  getline(cin, c);
  int ev = nv(a), ev1 = nv(b), ev2 = nv(c);
  if (ev == 5 && ev1 == 7 && ev2 == 5) {
    rpta = "YES";
  }
  cout << rpta << "\n";
  return 0;
}
