#include <bits/stdc++.h>
using namespace std;
int vowels(const string &A) {
  int result = 0;
  for (int i = 0; i < A.length(); i++) {
    result += (A[i] == 'a' || A[i] == 'e' || A[i] == 'i' || A[i] == 'o' ||
               A[i] == 'u');
  }
  return result;
}
int main() {
  int count[3];
  string s;
  for (int i = 0; i < 3; i++) {
    getline(cin, s);
    count[i] = vowels(s);
  }
  if (count[0] == 5 && count[1] == 7 && count[2] == 5)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
