#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long int n, i, f = 0;
  string s;
  getline(cin, s);
  n = s.length();
  for (i = n - 1; i >= 0; i--) {
    if (s[i] >= 'a' && s[i] <= 'z') {
      if (s[i] == 'a' || s[i] == 'e' || s[i] == 'i' || s[i] == 'o' ||
          s[i] == 'u' || s[i] == 'y') {
        f = 1;
        break;
      } else
        break;
    } else if (s[i] >= 'A' && s[i] <= 'Z') {
      if (s[i] == 'A' || s[i] == 'E' || s[i] == 'I' || s[i] == 'O' ||
          s[i] == 'U' || s[i] == 'Y') {
        f = 1;
        break;
      } else
        break;
    }
  }
  if (f == 0)
    cout << "NO";
  else
    cout << "YES";
  return 0;
}
