#include <bits/stdc++.h>
using namespace std;
char str[100005];
int main() {
  int x, y, z, p, q, r, ans, i, cnt, j;
  bool check = false;
  int flag = 0;
  int len;
  for (i = 0; i < 3; i++) {
    cnt = 0;
    gets(str);
    len = strlen(str);
    for (j = 0; j < len; j++) {
      if (str[j] == 'a' || str[j] == 'e' || str[j] == 'i' || str[j] == 'o' ||
          str[j] == 'u')
        cnt++;
    }
    if (cnt == 5 && i == 0)
      flag++;
    else if (cnt == 7 && i == 1)
      flag++;
    else if (cnt == 5 && i == 2)
      flag++;
  }
  if (flag == 3)
    puts("YES");
  else
    puts("NO");
  return 0;
}
