Language: C++

#pragma GCC optimize ("O3")

#include<bits/stdc++.h>
using namespace std;

const int w=20003;

char s[10005];
int x,y,_x,len,p,sum,q,now=1;
bool ws[2][2][40009];

int main(){
    register int i;
    scanf("%s%d%d",s+1,&x,&y),len=strlen(s+1),x+=w,y+=w;
    while(now<=len&&s[now]=='F') ++now,++_x;
    ws[0][0][w+_x]=1,ws[1][0][w]=1;
    while(now<=len){
        ++now,sum=0,p^=1,q^=p;
        while(now<=len&&s[now]=='F') ++sum,++now;
        for(int i=w-len;i<=w+len;++i) ws[p][q][i]=ws[p][q^1][i+sum]|ws[p][q^1][i-sum];
    }
    if(p==1&&ws[0][q^1][x]&&ws[1][q][y]||p==0&&ws[0][q][x]&&ws[1][q][y]) puts("Yes");
    else puts("No");
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:18: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   13 |     register int i;
      |                  ^
a.cc:16:5: error: reference to 'ws' is ambiguous
   16 |     ws[0][0][w+_x]=1,ws[1][0][w]=1;
      |     ^~
In file included from /usr/include/c++/14/istream:1109,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127,
                 from a.cc:3:
/usr/include/c++/14/bits/istream.tcc:1073:5: note: candidates are: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::ws(basic_istream<_CharT, _Traits>&)'
 1073 |     ws(basic_istream<_CharT, _Traits>& __in)
      |     ^~
a.cc:10:6: note:                 'bool ws [2][2][40009]'
   10 | bool ws[2][2][40009];
      |      ^~
a.cc:16:22: error: reference to 'ws' is ambiguous
   16 |     ws[0][0][w+_x]=1,ws[1][0][w]=1;
      |                      ^~
/usr/include/c++/14/bits/istream.tcc:1073:5: note: candidates are: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::ws(basic_istream<_CharT, _Traits>&)'
 1073 |     ws(basic_istream<_CharT, _Traits>& __in)
      |     ^~
a.cc:10:6: note:                 'bool ws [2][2][40009]'
   10 | bool ws[2][2][40009];
      |      ^~
a.cc:20:39: error: reference to 'ws' is ambiguous
   20 |         for(int i=w-len;i<=w+len;++i) ws[p][q][i]=ws[p][q^1][i+sum]|ws[p][q^1][i-sum];
      |                                       ^~
/usr/include/c++/14/bits/istream.tcc:1073:5: note: candidates are: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::ws(basic_istream<_CharT, _Traits>&)'
 1073 |     ws(basic_istream<_CharT, _Traits>& __in)
      |     ^~
a.cc:10:6: note:                 'bool ws [2][2][40009]'
   10 | bool ws[2][2][40009];
      |      ^~
a.cc:20:51: error: reference to 'ws' is ambiguous
   20 |         for(int i=w-len;i<=w+len;++i) ws[p][q][i]=ws[p][q^1][i+sum]|ws[p][q^1][i-sum];
      |                                                   ^~
/usr/include/c++/14/bits/istream.tcc:1073:5: note: candidates are: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::ws(basic_istream<_CharT, _Traits>&)'
 1073 |     ws(basic_istream<_CharT, _Traits>& __in)
      |     ^~
a.cc:10:6: note:                 'bool ws [2][2][40009]'
   10 | bool ws[2][2][40009];
      |      ^~
a.cc:20:69: error: reference to 'ws' is ambiguous
   20 |         for(int i=w-len;i<=w+len;++i) ws[p][q][i]=ws[p][q^1][i+sum]|ws[p][q^1][i-sum];
      |                                                                     ^~
/usr/include/c++/14/bits/istream.tcc:1073:5: note: candidates are: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::ws(basic_istream<_CharT, _Traits>&)'
 1073 |     ws(basic_istream<_CharT, _Traits>& __in)
      |     ^~
a.cc:10:6: note:                 'bool ws [2][2][40009]'
   10 | bool ws[2][2][40009];
      |      ^~
a.cc:22:14: error: reference to 'ws' is ambiguous
   22 |     if(p==1&&ws[0][q^1][x]&&ws[1][q][y]||p==0&&ws[0][q][x]&&ws[1][q][y]) puts("Yes");
      |              ^~
/usr/include/c++/14/bits/istream.tcc:1073:5: note: candidates are: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::ws(basic_istream<_CharT, _Traits>&)'
 1073 |     ws(basic_istream<_CharT, _Traits>& __in)
      |     ^~
a.cc:10:6: note:                 'bool ws [2][2][40009]'
   10 | bool ws[2][2][40009];
      |      ^~
a.cc:22:29: error: reference to 'ws' is ambiguous
   22 |     if(p==1&&ws[0][q^1][x]&&ws[1][q][y]||p==0&&ws[0][q][x]&&ws[1][q][y]) puts("Yes");
      |                             ^~
/usr/include/c++/14/bits/istream.tcc:1073:5: note: candidates are: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::ws(basic_istream<_CharT, _Traits>&)'
 1073 |     ws(basic_istream<_CharT, _Traits>& __in)
      |     ^~
a.cc:10:6: note:                 'bool ws [2][2][40009]'
   10 | bool ws[2][2][40009];
      |      ^~
a.cc:22:48: error: reference to 'ws' is ambiguous
   22 |     if(p==1&&ws[0][q^1][x]&&ws[1][q][y]||p==0&&ws[0][q][x]&&ws[1][q][y]) puts("Yes");
      |                                                ^~
/usr/include/c++/14/bits/istream.tcc:1073:5: note: candidates are: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::ws(basic_istream<_CharT, _Traits>&)'
 1073 |     ws(basic_istream<_CharT, _Traits>& __in)
      |     ^~
a.cc:10:6: note:                 'bool ws [2][2][40009]'
   10 | bool ws[2][2][40009];
      |      ^~
a.cc:22:61: error: reference to 'ws' is ambiguous
   22 |     if(p==1&&ws[0][q^1][x]&&ws[1][q][y]||p==0&&ws[0][q][x]&&ws[1][q][y]) puts("Yes");
      |                                                             ^~
/usr/include/c++/14/bits/istream.tcc:1073:5: note: candidates are: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::ws(basic_istream<_CharT, _Traits>&)'
 1073 |     ws(basic_istream<_CharT, _Traits>& __in)
      |     ^~
a.cc:10:6: note:                 'bool ws [2][2][40009]'
   10 | bool ws[2][2][40009];
      |      ^~