#include <bits/stdc++.h>
using namespace std;
string second;
int main() {
  getline(cin, second);
  for (int i = (second.size() - 1); i >= (0); i--) {
    if ((second[i] >= 'a' && second[i] <= 'z') ||
        (second[i] >= 'A' && second[i] <= 'Z')) {
      if (second[i] == 'A' || second[i] == 'E' || second[i] == 'I' ||
          second[i] == 'O' || second[i] == 'U' || second[i] == 'Y' ||
          second[i] == 'a' || second[i] == 'e' || second[i] == 'i' ||
          second[i] == 'o' || second[i] == 'u' || second[i] == 'y') {
        return cout << "YES", 0;
      }
      return cout << "NO", 0;
    }
  }
}
