#include <bits/stdc++.h>
using namespace std;
int main() {
  int n1, n2, n3;
  string a, b, c;
  int cnt1 = 0, cnt2 = 0, cnt3 = 0;
  getline(cin, a);
  getline(cin, b);
  getline(cin, c);
  n1 = a.length();
  n2 = b.length();
  n3 = c.length();
  for (int k = 0; k < n1; k++) {
    if (a[k] == 'a' || a[k] == 'e' || a[k] == 'u' || a[k] == 'i' || a[k] == 'o')
      cnt1++;
  }
  for (int k = 0; k < n2; k++) {
    if (b[k] == 'a' || b[k] == 'e' || b[k] == 'u' || b[k] == 'i' || b[k] == 'o')
      cnt2++;
  }
  for (int k = 0; k < n3; k++) {
    if (c[k] == 'a' || c[k] == 'e' || c[k] == 'u' || c[k] == 'i' || c[k] == 'o')
      cnt3++;
  }
  if (cnt1 == 5 && cnt2 == 7 && cnt3 == 5) {
    cout << "YES";
    return 0;
  }
  cout << "NO";
  return 0;
}
