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