#include <bits/stdc++.h>
using namespace std;
char s[105];
int32_t main() {
  int tc = 1;
  while (tc--) {
    int i = 0;
    char c;
    while (1) {
      cin >> c;
      s[i] = c;
      i++;
      if (c == '?') break;
    }
    vector<char> v;
    for (i = 101; i >= 0; i--) {
      if (s[i] == '?' &&
          (s[i - 1] == 'a' || s[i - 1] == 'e' || s[i - 1] == 'i' ||
           s[i - 1] == 'o' || s[i - 1] == 'u' || s[i - 1] == 'y' ||
           s[i - 1] == 'A' || s[i - 1] == 'E' || s[i - 1] == 'I' ||
           s[i - 1] == 'O' || s[i - 1] == 'U' || s[i - 1] == 'Y')) {
        v.push_back(s[i - 1]);
      }
    }
    if (v.size() == 0)
      cout << "NO";
    else
      cout << "YES";
  }
  return 0;
}
