#include <bits/stdc++.h>
using namespace std;
string S;
int ans;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  for (int i = 1; i <= 3; i++) {
    getline(cin, S);
    ans = 0;
    for (int j = 0; j < S.length(); j++) {
      if (S[j] == 'a' || S[j] == 'i' || S[j] == 'u' || S[j] == 'e' ||
          S[j] == 'o')
        ans++;
    }
    if (ans == 5 && i == 2) {
      cout << "NO\n";
      return 0;
    } else if (ans == 7 && i % 2 == 1) {
      cout << "NO\n";
      return 0;
    } else if (ans != 5 && ans != 7) {
      cout << "NO\n";
      return 0;
    }
  }
  cout << "YES\n";
}
