#include <bits/stdc++.h>
using namespace std;
bool isVowel(char s) {
  if (s == 'a' || s == 'e' || s == 'i' || s == 'o' || s == 'u') {
    return true;
  }
  return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string s1, s2, s3;
  int vowel_count_in_s1 = 0, vowel_count_in_s2 = 0, vowel_count_in_s3 = 0;
  getline(cin, s1);
  getline(cin, s2);
  getline(cin, s3);
  for (int i = 0; i < s1.length(); ++i) {
    if (isVowel(s1[i])) {
      ++vowel_count_in_s1;
    }
  }
  for (int i = 0; i < s2.length(); ++i) {
    if (isVowel(s2[i])) {
      ++vowel_count_in_s2;
    }
  }
  for (int i = 0; i < s3.length(); ++i) {
    if (isVowel(s3[i])) {
      ++vowel_count_in_s3;
    }
  }
  if (vowel_count_in_s1 == 5 && vowel_count_in_s2 == 7 &&
      vowel_count_in_s3 == 5) {
    cout << "YES";
  } else {
    cout << "NO";
  }
  return 0;
}
