#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  int dem, flag = 0;
  for (int i = 1; i <= 3; i++) {
    getline(cin, s);
    int ns = s.size();
    dem = 0;
    for (int j = 0; j < ns; j++)
      if (s[j] == 'a' || s[j] == 'i' || s[j] == 'e' || s[j] == 'u' ||
          s[j] == 'o')
        dem++;
    if (i == 1) {
      if (dem != 5) flag = 1;
    } else if (i == 2) {
      if (dem != 7) flag = 1;
    } else {
      if (dem != 5) flag = 1;
    }
  }
  if (flag == 1)
    cout << "NO";
  else
    cout << "YES";
}
