func_code_string: #include <bits/stdc++.h>   using namespace std;   inline pair<long long int, long long int> compute_pos(       pair<long long int, long long int> prev, char ch) {     int flag = 1;     pair<long long int, long long int> dest;     dest = prev;     if (ch ==  U ) dest.second += flag;     if (ch ==  D ) dest.second -= flag;     if (ch ==  R ) dest.first += flag;     if (ch ==  L ) dest.first -= flag;     return dest;   }   int main() {     string str;     pair<long long int, long long int> dest;     ios_base::sync_with_stdio(false);     cin >> dest.first >> dest.second;     cin >> str;     long long int R_num = 0, L_num = 0, U_num = 0, D_num = 0, i;     for (i = 0; i < str.length(); i++)       if (str[i] ==  U )         U_num++;       else if (str[i] ==  D )         D_num++;       else if (str[i] ==  L )         L_num++;       else         R_num++;     long long int initial_moves, initial_moves_1 = 0, initial_moves_2 = 0,                                  R_net = R_num - L_num, U_net = U_num - D_num;     if (R_net != 0) initial_moves_1 = dest.first / R_net;     if (U_net != 0) initial_moves_2 = dest.second / U_net;     int s_bit_1 = 1, s_bit_2 = 1;     s_bit_1 = dest.first > 0 ? 1 : -1;     s_bit_2 = dest.second > 0 ? 1 : -1;     while (initial_moves_1 * R_net * s_bit_1 + R_num >= s_bit_1 * dest.first &&            initial_moves_1 > 0)       initial_moves_1--;     while (initial_moves_2 * U_net * s_bit_2 + U_num >= s_bit_2 * dest.second &&            initial_moves_2 > 0)       initial_moves_2--;     initial_moves =         initial_moves_2 < initial_moves_1 ? initial_moves_1 : initial_moves_2;     pair<long long int, long long int> position;     position.first = 0;     position.second = 0;     initial_moves = initial_moves > 0 ? initial_moves : 0;     position.first = R_net * initial_moves;     position.second = U_net * initial_moves;     int flag = 0;     {       if (position == dest)         flag = 1;       else if (R_net == 0 && U_net == 0) {         for (i = 0; i < str.length(); i++) {           position = compute_pos(position, str[i]);           if (dest == position) {             flag = 1;             break;           }         }       } else {         while (true) {           for (i = 0; i < str.length(); i++) {             if (position == dest) {               flag = 1;               break;             }             position = compute_pos(position, str[i]);           }           if (position == dest) {             flag = 1;             break;           }           if (position.first - dest.first > L_num) break;           if (position.second - dest.second > D_num) break;           if (dest.first - position.first > R_num) break;           if (dest.second - position.second > U_num) break;         }       }     }     if (flag == 1)       cout <<  Yes  <<   n ;     else       cout <<  No  <<   n ;     return 0;   }   