#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 2;
const int M = 1e5 + 2;
const int mod = 1e9 + 7;
const int inf = 1e9;
const long long INF = 1e16;
void data() {}
template <typename T>
void scerr(T nums) {
  for (auto it : nums) cerr << it << " | ";
  cerr << "\n";
}
int n, ans, f = 1;
string s1, s2, s3;
int main() {
  data();
  scanf("%d", &n);
  getline(cin, s1);
  getline(cin, s2);
  getline(cin, s3);
  for (auto l : s1)
    if (l == 'a' || l == 'e' || l == 'i' || l == 'o' || l == 'u') ans++;
  if (ans != 5) f = 0;
  ans = 0;
  for (auto l : s2)
    if (l == 'a' || l == 'e' || l == 'i' || l == 'o' || l == 'u') ans++;
  if (ans != 7) f = 0;
  ans = 0;
  for (auto l : s3)
    if (l == 'a' || l == 'e' || l == 'i' || l == 'o' || l == 'u') ans++;
  if (ans != 5) f = 0;
  if (f)
    printf("YES");
  else
    printf("NO");
}
