#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  int cnt = 0, cnt1 = 0, cnt2 = 0;
  for (int i = 0; i < 3; i++) {
    getline(cin, s);
    for (int j = 0; j < s.length(); j++) {
      if (s[j] == 'a' || s[j] == 'i' || s[j] == 'o' || s[j] == 'u' ||
          s[j] == 'e') {
        if (i == 0) cnt++;
        if (i == 1) cnt1++;
        if (i == 2) cnt2++;
      }
    }
  }
  if (cnt == 5 && cnt1 == 7 && cnt2 == 5) {
    cout << "YES";
  } else {
    cout << "NO";
  }
}
