#include <bits/stdc++.h>
int main() {
  char n, a[5][1000];
  int i, j, count[5] = {0};
  for (i = 1; i <= 3; i++) {
    scanf("%[^\n]s", a[i]);
    n = strlen(a[i]);
    for (j = 0; j < n; j++)
      if (a[i][j] == 'a' || a[i][j] == 'e' || a[i][j] == 'i' ||
          a[i][j] == 'o' || a[i][j] == 'u')
        count[i]++;
    getchar();
  }
  if (count[1] != 5 || count[2] != 7 || count[3] != 5)
    printf("NO\n");
  else
    printf("YES\n");
  return 0;
}
