#include <bits/stdc++.h>
using namespace std;
int main() {
  string a, b, c;
  int count = 0;
  getline(cin, a);
  getline(cin, b);
  getline(cin, c);
  for (int i = 0; i < a.length(); i++) {
    if (a[i] == 'a' || a[i] == 'A' || a[i] == 'e' || a[i] == 'E' ||
        a[i] == 'i' || a[i] == 'I' || a[i] == 'o' || a[i] == 'O' ||
        a[i] == 'u' || a[i] == 'U') {
      count++;
    }
  }
  if (count != 5) {
    cout << "NO" << endl;
    return 0;
  }
  count = 0;
  for (int i = 0; i < b.length(); i++) {
    if (b[i] == 'a' || b[i] == 'A' || b[i] == 'e' || b[i] == 'E' ||
        b[i] == 'i' || b[i] == 'I' || b[i] == 'o' || b[i] == 'O' ||
        b[i] == 'u' || b[i] == 'U') {
      count++;
    }
  }
  if (count != 7) {
    cout << "NO" << endl;
    return 0;
  }
  count = 0;
  for (int i = 0; i < c.length(); i++) {
    if (c[i] == 'a' || c[i] == 'A' || c[i] == 'e' || c[i] == 'E' ||
        c[i] == 'i' || c[i] == 'I' || c[i] == 'o' || c[i] == 'O' ||
        c[i] == 'u' || c[i] == 'U') {
      count++;
    }
  }
  if (count != 5) {
    cout << "NO" << endl;
    return 0;
  }
  cout << "YES" << endl;
}
