#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-9;
const double PI = acos(-1);
const int INF = (int)1e9 + 7;
const int MAXN = (int)2e6 + 7;
string vowels = "aeiou";
bool isVowel(char x) {
  for (auto it : vowels)
    if (it == x) return true;
  return false;
}
int countVowels(string second) {
  int res = 0;
  for (auto it : second) res += isVowel(it);
  return res;
}
int main() {
  string a, b, c;
  getline(cin, a);
  getline(cin, b);
  getline(cin, c);
  if (countVowels(a) == 5 && countVowels(b) == 7 && countVowels(c) == 5) {
    cout << "YES";
  } else {
    cout << "NO";
  }
  return 0;
}
