#include <bits/stdc++.h>
using namespace std;
template <typename... T>
inline void input(T &...args) {
  ((cin >> args), ...);
}
template <typename... T>
inline void print(T &&...args) {
  ((cout << args << " "), ...);
}
template <typename... T>
inline void println(T &&...args) {
  print(args...);
  cout << "\n";
}
int count_vowels(string s) {
  int num = 0;
  string vowels = "aeiou";
  for (auto &c : s) {
    if (vowels.find(c) != string::npos) {
      num++;
    }
  }
  return num;
}
int main() {
  cin.tie(nullptr);
  cout.tie(nullptr);
  ios::sync_with_stdio(false);
  string a, b, c;
  getline(cin, a);
  getline(cin, b);
  getline(cin, c);
  if (count_vowels(a) == 5 && count_vowels(b) == 7 && count_vowels(c) == 5) {
    print("YES");
  } else {
    print("NO");
  }
  return 0;
}
