#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  ;
  string s;
  getline(cin, s);
  int h = s.size() - 1;
  while (s[h] == '?' || s[h] == ' ') {
    h--;
  }
  if (s[h] == 'A' || s[h] == 'a' || s[h] == 'i' || s[h] == 'I' || s[h] == 'O' ||
      s[h] == 'o' || s[h] == 'u' || s[h] == 'U' || s[h] == 'Y' || s[h] == 'y' ||
      s[h] == 'e' || s[h] == 'E') {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
  return 0;
}
