#include <bits/stdc++.h>
using namespace std;
unsigned long long int gcd(unsigned long long int a, unsigned long long int b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
int main() {
  string s;
  getline(cin, s);
  string ans = "NO";
  for (int i = s.length() - 1; i >= 0; i--) {
    if (s[i] != '?' && s[i] != ' ') {
      if (s[i] == 'a' || s[i] == 'A' || s[i] == 'E' || s[i] == 'e' ||
          s[i] == 'I' || s[i] == 'i' || s[i] == 'O' || s[i] == 'o' ||
          s[i] == 'U' || s[i] == 'u' || s[i] == 'Y' || s[i] == 'y')
        ans = "YES";
      break;
    }
  }
  cout << ans << endl;
}
