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