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