#include <bits/stdc++.h>
using namespace std;
char str[3][115];
int cnt[3];
int main() {
  int i, j;
  gets(str[0]);
  gets(str[1]);
  gets(str[2]);
  memset(cnt, 0, sizeof cnt);
  for (i = 0; i < 3; i++)
    for (j = 0; j < strlen(str[i]); j++)
      if (str[i][j] == 'a' || str[i][j] == 'e' || str[i][j] == 'i' ||
          str[i][j] == 'o' || str[i][j] == 'u')
        cnt[i]++;
  if (cnt[0] == 5 && cnt[1] == 7 && cnt[2] == 5)
    printf("YES\n");
  else
    printf("NO\n");
  return 0;
}
