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