#include <bits/stdc++.h>
int main() {
  int count = 0, p = 1, ok = 0;
  char c = 1;
  while (c != 0) {
    c = getchar();
    switch (c) {
      case 'a':
      case 'e':
      case 'i':
      case 'o':
      case 'u':
        count++;
        break;
      case '\n': {
        switch (p) {
          case 1:
            ok += (count == 5);
            break;
          case 2:
            ok += (count == 7);
            break;
          case 3:
            ok += (count == 5);
            c = 0;
            break;
          default:
            ok = 0;
        }
        p++;
        count = 0;
      } break;
      case 0:
        if (p == 3) {
          ok += (count == 7);
        } else
          ok = 0;
        break;
    }
  }
  if (ok == 3)
    printf("YES");
  else
    printf("NO");
  return 0;
}
