#include <bits/stdc++.h>
using namespace std;
bool isHaiku(int n) {
  string s;
  getline(cin, s);
  int count = 0;
  for (int i = 0; i < s.length(); i++) {
    if (s[i] == 'a' || s[i] == 'e' || s[i] == 'i' || s[i] == 'o' ||
        s[i] == 'u') {
      count++;
    }
  }
  if (count == n) {
    return true;
  } else {
    return false;
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  if (isHaiku(5) && isHaiku(7) && isHaiku(5)) {
    cout << "YES";
  } else {
    cout << "NO";
  }
  return 0;
}
