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