#include <bits/stdc++.h>
using namespace std;
int main() {
  string s, b, v;
  getline(cin, s);
  int ans = 0;
  int tnt = 0;
  int box = 0;
  ;
  for (int i = 0; s.size() > i; i++) {
    if (s[i] == 'a' || s[i] == 'e' || s[i] == 'i' || s[i] == 'o' || s[i] == 'u')
      ans++;
  }
  getline(cin, b);
  for (int i = 0; b.size() > i; i++) {
    if (b[i] == 'a' || b[i] == 'e' || b[i] == 'i' || b[i] == 'o' || b[i] == 'u')
      tnt++;
  }
  getline(cin, v);
  for (int i = 0; v.size() > i; i++) {
    if (v[i] == 'a' || v[i] == 'e' || v[i] == 'i' || v[i] == 'o' || v[i] == 'u')
      box++;
  }
  if (ans == 5 and tnt == 7 and box == 5) {
    cout << "YES";
  } else
    cout << "NO";
  return 0;
}
