#include <bits/stdc++.h>
using namespace std;
priority_queue<int, vector<int>, greater<int> > pq;
long long int MOD = 1000000007;
char str[101];
int chk(char str[]) {
  int len = strlen(str);
  int cnt = 0;
  for (int i = 0; i < len; i++) {
    if (str[i] == 'a' || str[i] == 'e' || str[i] == 'i' || str[i] == 'o' ||
        str[i] == 'u')
      cnt++;
  }
  return cnt;
}
int main() {
  gets(str);
  int n = chk(str);
  if (n != 5) {
    cout << "NO";
    return 0;
  }
  gets(str);
  n = chk(str);
  if (n != 7) {
    cout << "NO";
    return 0;
  }
  gets(str);
  n = chk(str);
  if (n != 5) {
    cout << "NO";
    return 0;
  }
  cout << "YES";
  return 0;
}
