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