#include <bits/stdc++.h>
using namespace std;
char as[105], bs[105], cs[105];
int main() {
  while (gets(as) && gets(bs) && gets(cs)) {
    int cnt = 0, flag = 0;
    for (int i = 0; i < strlen(as); i++) {
      if (as[i] == 'a' || as[i] == 'e' || as[i] == 'i' || as[i] == 'o' ||
          as[i] == 'u')
        cnt++;
    }
    if (cnt != 5) flag = 1;
    cnt = 0;
    if (flag == 0) {
      for (int i = 0; i < strlen(bs); i++) {
        if (bs[i] == 'a' || bs[i] == 'e' || bs[i] == 'i' || bs[i] == 'o' ||
            bs[i] == 'u')
          cnt++;
      }
      if (cnt != 7) flag = 1;
    }
    cnt = 0;
    if (flag == 0) {
      for (int i = 0; i < strlen(cs); i++) {
        if (cs[i] == 'a' || cs[i] == 'e' || cs[i] == 'i' || cs[i] == 'o' ||
            cs[i] == 'u')
          cnt++;
      }
      if (cnt != 5) flag = 1;
    }
    if (flag == 0)
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
