#include <bits/stdc++.h>
using namespace std;
bool isVowel(char c) {
  if (c == 'a' || c == 'e' || c == 'u' || c == 'i' || c == 'o') {
    return true;
  }
  return false;
}
int getVowelCount(const string& s) {
  const char* data = s.c_str();
  int size = s.size();
  int result = 0;
  for (int i = 0; i < size; i++) {
    if (isVowel(data[i])) {
      result++;
    }
  }
  return result;
}
int main() {
  bool result = true;
  string temp;
  getline(cin, temp);
  if (getVowelCount(temp) != 5) result = false;
  getline(cin, temp);
  if (getVowelCount(temp) != 7) result = false;
  getline(cin, temp);
  if (getVowelCount(temp) != 5) result = false;
  if (result) {
    std::cout << ("YES") << endl;
  } else {
    std::cout << ("NO") << endl;
  }
  return 0;
}
