#include <bits/stdc++.h>
using namespace std;
int main() {
  int x = 0, n = 0, m = 0;
  string a, b, c;
  getline(cin, a);
  getline(cin, b);
  getline(cin, c);
  for (int i = 0; i < a.length(); i++) {
    if (a[i] == 'a' || a[i] == 'o' || a[i] == 'i' || a[i] == 'e' ||
        a[i] == 'u') {
      x++;
    }
  }
  for (int i = 0; i < b.length(); i++) {
    if (b[i] == 'a' || b[i] == 'o' || b[i] == 'i' || b[i] == 'e' ||
        b[i] == 'u') {
      n++;
    }
  }
  for (int i = 0; i < c.length(); i++) {
    if (c[i] == 'a' || c[i] == 'o' || c[i] == 'i' || c[i] == 'e' ||
        c[i] == 'u') {
      m++;
    }
  }
  if (x == 5 && n == 7 && m == 5) {
    cout << "YES";
  } else {
    cout << "NO";
  }
  return 0;
}
