#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t = 3;
  long long idx = 1;
  long long arr[26] = {0};
  arr['a' - 'a'] = 1;
  arr['e' - 'a'] = 1;
  arr['i' - 'a'] = 1;
  arr['o' - 'a'] = 1;
  arr['u' - 'a'] = 1;
  bool flag = 0;
  while (t--) {
    string str;
    getline(cin, str);
    while (str.length() == 0) {
      getline(cin, str);
    }
    long long cnt_v = 0;
    for (auto x : str) {
      if (arr[x - 'a'] == 1) cnt_v++;
    }
    if (idx == 1) {
      if (cnt_v != 5) flag = 1;
    } else if (idx == 2) {
      if (cnt_v != 7) flag = 1;
    } else if (idx == 3) {
      if (cnt_v != 5) flag = 1;
    }
    idx++;
  }
  if (flag == 1) {
    cout << "NO\n";
  } else {
    cout << "YES\n";
  }
}
