#include <bits/stdc++.h>
using namespace std;
long long a[99999];
int main() {
  ios_base ::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string s;
  long long n = 3;
  long long c1 = 0, c2 = 0, c3 = 0;
  while (n--) {
    getline(cin, s);
    long long c = 0;
    for (long long i = 0; i < s.size(); i++) {
      if (s[i] == 'a' || s[i] == 'e' || s[i] == 'i' || s[i] == 'o' ||
          s[i] == 'u')
        ++c;
    }
    if (c == 5 && !c1)
      c1 = 1;
    else if (c == 7 && !c2)
      c2 = 1;
    else if (c == 5 && !c3)
      c3 = 1;
  }
  if (c1 && c2 && c3)
    cout << "YES";
  else
    cout << "NO";
}
