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