[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
    declare long longs a and b
    read a and b and keep looping
        declare new string variable s
        declare long long variables x and y = 0
        read standard input to s
        create new long long called i
        for i = 0 to length of s exclusive
            if x = a and y = b, stop the loop
            if s[i] is equal to 'L', change x to x - 1
            if s[i] = 'R', change x to the sum of x and 1
            if s[i] = 'U', change y to the sum of y and 1
            if s[i] = 'D', decrease y by 1
        end of the block
        declare new long long variable j
        if i = length of s
            for j from 0 to length of s exclusive
                if s[j] is equal to 'L', increase a by 1
                if s[j] is equal to 'R', subtract 1 from a
                if s[j] is equal to 'U', subtract 1 from b
                if s[j] is equal to 'D', add 1 to b
                if a = 0 and b is equal to 0, stop the loop
                create long long variable da with value = absolute value of a
                declare new long long db with value abs(b)
                dx is a new long long variable = abs(x)
                declare long long variable dy = absolute value of y
                if a * y = b * x && a * x >= 0 && b * y >= 0
                    if a != 0 and b != 0
                        if dx != 0 and dy != 0
                            if da % dx = 0 and db % dy = 0, break the loop
                        end of the block
                    else if a != 0 and b = 0
                        if dx != 0
                            if dy is equal to 0 and da%dx = 0, stop the loop
                        end of the block
                    else if a = 0 and b != 0
                        if dy != 0
                            if dx = 0 and db % dy is equal to 0, break
                        end of the block
                    end of the block
                end of the block
            end of the block
            if j != length of s
                print "Yes"
            else
                print "No" to the standard output
            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;
}