#include <bits/stdc++.h>
using namespace std;
char s[1001];
int main() {
  int huang = 1, i, tot;
  cin.getline(s, 1000);
  tot = 0;
  for (i = 0; i < strlen(s); i++) {
    if (s[i] == 'a') tot++;
    if (s[i] == 'e') tot++;
    if (s[i] == 'i') tot++;
    if (s[i] == 'o') tot++;
    if (s[i] == 'u') tot++;
  }
  if (tot != 5) huang = 0;
  cin.getline(s, 1000);
  tot = 0;
  for (i = 0; i < strlen(s); i++) {
    if (s[i] == 'a') tot++;
    if (s[i] == 'e') tot++;
    if (s[i] == 'i') tot++;
    if (s[i] == 'o') tot++;
    if (s[i] == 'u') tot++;
  }
  if (tot != 7) huang = 0;
  cin.getline(s, 1000);
  tot = 0;
  for (i = 0; i < strlen(s); i++) {
    if (s[i] == 'a') tot++;
    if (s[i] == 'e') tot++;
    if (s[i] == 'i') tot++;
    if (s[i] == 'o') tot++;
    if (s[i] == 'u') tot++;
  }
  if (tot != 5) huang = 0;
  if (huang)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
