#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int t;
  t = 1;
  while (t--) {
    int c = 0;
    std::vector<int> v;
    string s[3];
    getline(cin, s[0]);
    getline(cin, s[1]);
    getline(cin, s[2]);
    for (int i = 0; i <= 2; i++) {
      for (int j = 0; j <= s[i].length() - 1; j++) {
        if (s[i][j] == 'a' || s[i][j] == 'e' || s[i][j] == 'i' ||
            s[i][j] == 'o' || s[i][j] == 'u')
          c++;
      }
      v.push_back(c);
      c = 0;
    }
    if (v[0] == 5 && v[1] == 7 && v[2] == 5) {
      cout << "YES";
    } else {
      cout << "NO";
    }
  }
  cerr << "Time taken : " << (float)clock() / CLOCKS_PER_SEC << " secs" << endl;
  return 0;
}
