#include <bits/stdc++.h>
using namespace std;
bool chk(char ch) {
  if (ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u')
    return true;
  return false;
}
int main() {
  string s1, s2, s3;
  int c1 = 0, c2 = 0, c3 = 0;
  getline(cin, s1);
  getline(cin, s2);
  getline(cin, s3);
  for (int i = 0; i < s1.length(); i++)
    if (chk(s1[i])) c1++;
  for (int i = 0; i < s2.length(); i++)
    if (chk(s2[i])) c2++;
  for (int i = 0; i < s3.length(); i++)
    if (chk(s3[i])) c3++;
  if (c1 == 5 && c2 == 7 && c3 == 5)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
