#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, i, sajjad = 0, sa = 0, sai = 0;
  string s1;
  string s2;
  string s3;
  getline(cin, s1);
  getline(cin, s2);
  getline(cin, s3);
  sort(s1.begin(), s1.end());
  for (i = 0; i < s1.size(); i++) {
    if (s1[i] == 'a' || s1[i] == 'e' || s1[i] == 'i' || s1[i] == 'o' ||
        s1[i] == 'u') {
      sajjad++;
    }
  }
  sort(s2.begin(), s2.end());
  for (i = 0; i < s2.size(); i++) {
    if (s2[i] == 'a' || s2[i] == 'e' || s2[i] == 'i' || s2[i] == 'o' ||
        s2[i] == 'u') {
      sa++;
    }
  }
  sort(s3.begin(), s3.end());
  for (i = 0; i < s3.size(); i++) {
    if (s3[i] == 'a' || s3[i] == 'e' || s3[i] == 'i' || s3[i] == 'o' ||
        s3[i] == 'u') {
      sai++;
    }
  }
  if (sajjad == 5 && sa == 7 && sai == 5) {
    cout << "YES" << '\n';
  } else {
    cout << "NO" << '\n';
  }
  return 0;
}
