[TASK]:
You will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.

[INSTRUCTION]:
The following libraries are already included in the code.
```cpp
#include <cstdio>
#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <cstring>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <fstream>
#include <climits>
#include <cassert>
#include <iomanip>
#include <sstream>
#include <bitset>
using namespace std;
```
Do not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.

[PSEUDOCODE]:
s = string
a, b = integer
cx, cy = integers with cx = 0, cy = 0
define the main function
    read a, b
    read s
    for i = 0 to ((cast to int)(s).size())
        if cx is a and cy is b
            print Yes
            return to indicate successful execution
        end of the block
        if s[i] is U
            increment cy
        else if s[i] is D
            cy decrement
        else if s[i] is R
            increment cx
        else
            decrement cx
        if cx is a and cy is b
            print Yes
            return to indicate successful execution
        end of the block
    end of the block
    if cx
        t = integer with t = abs(a) / abs(cx)
        for now = t - 1000 to t + 1000
            if now < 0, continue new iteration
            first = long long with first = (cast to long long)cx * now
            second = long long with second = (cast to long long)cy * now
            for i = 0 to ((cast to int)(s).size())
                if first is a and second is b
                    print Yes
                    return to indicate successful execution
                end of the block
                if s[i] is U
                    increment second
                else if s[i] is D
                    decrement second
                else if s[i] is R
                    increment first
                else
                    decrement first
                if first is a and second is b
                    print Yes
                    return to indicate successful execution
                end of the block
            end of the block
        end of the block
    end of the block
    if cy
        t = integer with t = abs(b) / abs(cy)
        for now = t - 1000 to t + 1000
            if now < 0, continue next iteration
            first = long long with first = (cast to long long)cx * now
            second = long long with second = (cast to long long)cy * now
            for i = 0 to ((cast to int)(s).size())
                if first is a and second is b
                    print Yes
                    return to indicate successful execution
                end of the block
                if s[i] is U
                    increment second
                else if s[i] is D
                    decrement second
                else if s[i] is R
                    increment first
                else
                    decrement first
                if first is a and second is b
                    print Yes
                    return to indicate successful execution
                end of the block
            end of the block
        end of the block
    end of the block
    print No
end of the block

[CODE]:

string s;
int a, b;
int cx = 0, cy = 0;
int main() {
    cin >> a >> b;
    cin >> s;
    for (int i = 0; i < ((int)(s).size()); ++i) {
        if (cx == a && cy == b) {
            cout << "Yes\n";
            return 0;
        }
        if (s[i] == 'U')
            cy++;
        else if (s[i] == 'D')
            cy--;
        else if (s[i] == 'R')
            cx++;
        else
            cx--;
        if (cx == a && cy == b) {
            cout << "Yes\n";
            return 0;
        }
    }
    if (cx) {
        int t = abs(a) / abs(cx);
        for (int now = t - 1000; now <= t + 1000; ++now) {
            if (now < 0) continue;
            long long first = (long long)cx * now;
            long long second = (long long)cy * now;
            for (int i = 0; i < ((int)(s).size()); ++i) {
                if (first == a && second == b) {
                    cout << "Yes\n";
                    return 0;
                }
                if (s[i] == 'U')
                    second++;
                else if (s[i] == 'D')
                    second--;
                else if (s[i] == 'R')
                    first++;
                else
                    first--;
                if (first == a && second == b) {
                    cout << "Yes\n";
                    return 0;
                }
            }
        }
    }
    if (cy) {
        int t = abs(b) / abs(cy);
        for (int now = t - 1000; now <= t + 1000; ++now) {
            if (now < 0) continue;
            long long first = (long long)cx * now;
            long long second = (long long)cy * now;
            for (int i = 0; i < ((int)(s).size()); ++i) {
                if (first == a && second == b) {
                    cout << "Yes\n";
                    return 0;
                }
                if (s[i] == 'U')
                    second++;
                else if (s[i] == 'D')
                    second--;
                else if (s[i] == 'R')
                    first++;
                else
                    first--;
                if (first == a && second == b) {
                    cout << "Yes\n";
                    return 0;
                }
            }
        }
    }
    cout << "No\n";
}