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