#include <bits/stdc++.h>
using namespace std;
char s[110];
int cnt[3];
char a[5] = {'a', 'e', 'i', 'o', 'u'};
int main() {
  for (int k = 0; k < 3; k++) {
    gets(s);
    int len = strlen(s);
    for (int i = 0; i < len; i++) {
      bool check = false;
      for (int j = 0; j < 5; j++) {
        if (a[j] == s[i]) {
          check = true;
          break;
        }
      }
      if (check == true) {
        cnt[k]++;
      }
    }
  }
  if (cnt[0] == 5 && cnt[1] == 7 && cnt[2] == 5) {
    printf("YES\n");
  } else
    printf("NO\n");
  return 0;
}
