#include <bits/stdc++.h>
using namespace std;
int a[3];
int main() {
  for (int k = 0; k < 3; k++) {
    string s;
    getline(cin, s);
    for (int i = 0; i < s.length(); i++)
      if (s[i] == 'a' || s[i] == 'o' || s[i] == 'u' || s[i] == 'e' ||
          s[i] == 'i')
        a[k]++;
  }
  if (a[0] == 5 && a[1] == 7 && a[2] == 5)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
