#include <bits/stdc++.h>
using namespace std;
char s[1000100], dummy[10];
int n, p[1000100], present[1000100];
int is_vowel(char ch) {
  if (ch >= 'A' && ch <= 'Z') {
    ch -= 'A';
    ch += 'a';
  }
  if (ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u' ||
      ch == 'y') {
    return 1;
  }
  return 0;
}
int get_vowels(char s[]) {
  int ret = 0;
  for (int i = 0; s[i]; i++) {
    ret += is_vowel(s[i]);
  }
  return ret;
}
int main() {
  int i;
  while (scanf("%d", &n) == 1) {
    for (i = 0; i < n; i++) {
      scanf("%d", &p[i]);
    }
    gets(dummy);
    bool possible = true;
    for (i = 0; i < n; i++) {
      gets(s);
      if (get_vowels(s) != p[i]) {
        possible = false;
      }
    }
    if (possible)
      puts("YES");
    else {
      puts("NO");
    }
  }
  return 0;
}
