#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  char ch[101];
  int s[3] = {5, 7, 5};
  bool h(true);
  for (int i = 0; i < 3; ++i) {
    cin.getline(ch, sizeof(ch) / sizeof(ch[0]));
    int n = 0;
    for (int j = 0; ch[j] != 0; ++j) {
      if (ch[j] == 'a' || ch[j] == 'e' || ch[j] == 'i' || ch[j] == 'o' ||
          ch[j] == 'u') {
        n += 1;
      }
    }
    if (n != s[i]) {
      h = false;
    }
  }
  cout << (h ? "YES" : "NO") << endl;
  return 0;
}
