#include <bits/stdc++.h>
char a[110], b[110], c[110];
int main() {
  gets(a);
  gets(b);
  gets(c);
  int cnt1 = 0, cnt2 = 0, cnt3 = 0;
  for (int i = 0; i < strlen(a); i++)
    if (a[i] == 'a' || a[i] == 'e' || a[i] == 'i' || a[i] == 'o' || a[i] == 'u')
      cnt1++;
  for (int i = 0; i < strlen(b); i++)
    if (b[i] == 'a' || b[i] == 'e' || b[i] == 'i' || b[i] == 'o' || b[i] == 'u')
      cnt2++;
  for (int i = 0; i < strlen(c); i++)
    if (c[i] == 'a' || c[i] == 'e' || c[i] == 'i' || c[i] == 'o' || c[i] == 'u')
      cnt3++;
  if (cnt1 == 5 && cnt2 == 7 && cnt3 == 5)
    printf("YES\n");
  else
    printf("NO\n");
  return 0;
}
