#include <bits/stdc++.h>
using namespace std;
signed main() {
  string a;
  getline(cin, a);
  for (int i = 0; i < a.size(); i++) {
    if (a[i] >= 65 && a[i] <= 91) {
      a[i] += 32;
    }
  }
  for (int i = a.size() - 1; i >= 0; i--) {
    if (a[i] < 97 || a[i] > 122) continue;
    if ((a[i] != 'a' && a[i] != 'e' && a[i] != 'i' && a[i] != 'o' &&
         a[i] != 'u' && a[i] != 'y')) {
      cout << "NO\n";
      return 0;
    }
    break;
  }
  cout << "YES\n";
}
