#include <bits/stdc++.h>
using namespace std;
char s1[200], s2[200], s3[200];
string egshig = "aeiou";
int cnt1 = 0, cnt2 = 0, cnt3 = 0;
int main() {
  gets(s1);
  gets(s2);
  gets(s3);
  for (int i = 0; i < strlen(s1); i++) {
    bool ok = false;
    for (int j = 0; j < (int)egshig.size(); j++) {
      if (s1[i] == (char)egshig[j]) ok = true;
    }
    if (ok) cnt1++;
  }
  for (int i = 0; i < strlen(s2); i++) {
    bool ok = false;
    for (int j = 0; j < (int)egshig.size(); j++) {
      if (s2[i] == (char)egshig[j]) ok = true;
    }
    if (ok) cnt2++;
  }
  for (int i = 0; i < strlen(s3); i++) {
    bool ok = false;
    for (int j = 0; j < (int)egshig.size(); j++) {
      if (s3[i] == (char)egshig[j]) ok = true;
    }
    if (ok) cnt3++;
  }
  if (cnt1 == 5 && cnt2 == 7 && cnt3 == 5)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
