#include <bits/stdc++.h>
using namespace std;
ifstream in("input.txt");
ofstream out("output.txt");
string s, a = "aAeEiIoOuUyY";
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  getline(cin, s);
  for (int i = s.size() - 1; i >= 0; --i)
    if ((s[i] >= 'a' && s[i] <= 'z') || (s[i] >= 'A' && s[i] <= 'Z')) {
      for (int j = 0; j < a.size(); ++j)
        if (s[i] == a[j]) {
          cout << "YES";
          return 0;
        }
      cout << "NO";
      return 0;
    }
  in.close();
  out.close();
  return 0;
}
