#include <bits/stdc++.h>
using namespace std;
int main() {
  int t = 0, counterarr[3] = {5, 7, 5}, c = 0;
  string x;
  bool arr[3] = {};
  while (t < 3) {
    getline(cin, x);
    for (int i = 0; i < x.length(); i++) {
      if (x[i] == 'a' || x[i] == 'e' || x[i] == 'u' || x[i] == 'i' ||
          x[i] == 'o')
        c++;
    }
    if (c == counterarr[t]) {
      arr[t] = true;
    }
    c = 0;
    t++;
  }
  if (arr[0] == 1 && arr[1] == 1 && arr[2] == 1)
    cout << "YES\n";
  else
    cout << "NO\n";
}
