#include <bits/stdc++.h>
struct pair_hash {
  template <class T1, class T2>
  std::size_t operator()(const std::pair<T1, T2> &pair) const {
    return std::hash<T1>()(pair.first) ^ std::hash<T2>()(pair.second);
  }
};
int main() {
  std::string s;
  int blue = 0;
  std::cin >> s;
  for (int i = 0; i < s.length(); i++) {
    if (s[i] == 'B')
      blue++;
    else
      blue--;
  }
  if (blue < 0)
    std::cout << "Yes";
  else
    std::cout << "No";
  return 0;
}
