#include <bits/stdc++.h>
int count(const std::string& s) {
  int c = 0;
  std::string v = "aiueo";
  int n = s.size();
  for (int i = 0; i < n; ++i) {
    if (v.find(s[i]) != std::string::npos) {
      ++c;
    }
  }
  return c;
}
int main() {
  std::string line1;
  std::getline(std::cin, line1);
  std::string line2;
  std::getline(std::cin, line2);
  std::string line3;
  std::getline(std::cin, line3);
  if (count(line1) == 5 && count(line2) == 7 && count(line3) == 5) {
    std::cout << "YES";
  } else {
    std::cout << "NO";
  }
  std::cout << std::endl;
}
