[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]:
define the main function
    a, b = long long
    loop while reading a then b
        s = string
        x, y = long long with x = 0 and y = 0
        read s
        i = long long
        for i = 0 to size of s
            if x is a and y is b break
            if s[i] is 'L' decrement x
            if s[i] is 'R' increment x
            if s[i] is 'U' increment y
            if s[i] is 'D' decrement y
        end of the block
        j = long long
        if i is size of s
            for j = 0 to size of s
                if s[j] is 'L' increment a
                if s[j] is 'R' decrement a
                if s[j] is 'U' decrement b
                if s[j] is 'D' increment b
                if a and b are both 0 break
                da = long long with da = absolute of a
                db = long long with db = absolute of b
                dx = long long with dx = absolute of x
                dy = long long with dy = absolute of y
                if a as long long * y is b as long long * x and a as long long * x >= 0 and b as long long * y >= 0
                    if a and b are both not 0
                        if dx and dy are both not 0
                            if da is a multiple of dx and db is a multiple of dy break
                        end of the block
                    else if a is not 0 and b is 0
                        if dx is not 0
                            if dy is 0 and da is a multiple of dx break
                        end of the block
                    else if a is 0 and b is not 0
                        if dy is not 0
                            if dx is 0 and db is a multiple of dy break
                        end of the block
                    end of the block
                end of the block
            end of the block
            if j is not size of s
                print "Yes"
            else
                print "No"
            end of the block
        else
            print "Yes"
        end of the block
    end of the block
    return to indicate successful execution
end of the block

[CODE]:

int main() {
    long long a, b;
    while (cin >> a >> b) {
        string s;
        long long x = 0, y = 0;
        cin >> s;
        long long i;
        for (i = 0; i < s.size(); i++) {
            if (x == a && y == b) break;
            if (s[i] == 'L') x -= 1;
            if (s[i] == 'R') x += 1;
            if (s[i] == 'U') y += 1;
            if (s[i] == 'D') y -= 1;
        }
        long long j;
        if (i == s.size()) {
            for (j = 0; j < s.size(); j++) {
                if (s[j] == 'L') a += 1;
                if (s[j] == 'R') a -= 1;
                if (s[j] == 'U') b -= 1;
                if (s[j] == 'D') b += 1;
                if (a == 0 && b == 0) break;
                long long da = abs(a);
                long long db = abs(b);
                long long dx = abs(x);
                long long dy = abs(y);
                if ((long long)a * y == (long long)b * x && (long long)a * x >= 0 && (long long)b * y >= 0) {
                    if (a != 0 && b != 0) {
                        if (dx != 0 && dy != 0) {
                            if (da % dx == 0 && db % dy == 0) break;
                        }
                    } else if (a != 0 && b == 0) {
                        if (dx != 0) {
                            if (dy == 0 && da % dx == 0) break;
                        }
                    } else if (a == 0 && b != 0) {
                        if (dy != 0) {
                            if (dx == 0 && db % dy == 0) break;
                        }
                    }
                }
            }
            if (j != s.size()) {
                cout << "Yes" << endl;
            } else {
                cout << "No" << endl;
            }
        } else {
            cout << "Yes" << endl;
        }
    }
    return 0;
}