#include <bits/stdc++.h>
int m[3] = {5, 7, 5}, k;
int main() {
  for (int i = 0; i < 3; ++i, k = 0) {
    char c;
    while ((c = getchar()) && c != '\n')
      k += c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u';
    if (k != m[i]) {
      puts("NO");
      return 0;
    }
  }
  puts("YES");
  return 0;
}
