#include <bits/stdc++.h>
using namespace std;
int get(string s) {
  int ans = 0;
  for (int i = 0; i < s.length(); i++)
    if (s[i] == 'a' || s[i] == 'e' || s[i] == 'u' || s[i] == 'i' || s[i] == 'o')
      ans++;
  return ans;
}
int main() {
  string s;
  int numb;
  for (int i = 0; i < 3; i++) {
    getline(cin, s);
    numb = get(s);
    if (i == 0 || i == 2)
      if (numb != 5) {
        puts("NO");
        return 0;
      }
    if (i == 1)
      if (numb != 7) {
        puts("NO");
        return 0;
      }
  }
  puts("YES");
  return 0;
}
