[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]:
declare constant integer MAX = 2e6, mod = 998244353
declare integer array dp size MAX by 26
declare boolean ck with long longs lu, ld, ru, rd as arguments
    if lu is true
        declare long long step = absolute value of ( ld / lu )
        if lu * step is ld and ru * step is rd, return 1
    end of the block
    if ru is true
        declare long long step = absolute value of rd / ru
        if lu * step is ld and ru * step is rd, return 1
    end of the block
    return to indicate successful execution
end of the block
define the main function
    declare integers a, b
    declare string x
    read a, b, x
    declare integer n = size of x
    declare long longs tx = 0, ty = 0
    declare long longs cx = 0, cy = 0
    for i = 0 to n exclusive
        if x[i] is 'R'
            increment tx
        else if x[i] is 'L'
            decrement tx
        else if x[i] is 'U'
            increment ty
        else if x[i] is 'D'
            decrement ty
    end of the block
    if result of ck(tx, a, ty, b) or ( a is tx and b is ty ), return print ( "Yes" ), 0
    for i = 0 to n exclusive
        if x[i] is 'R'
            increment cx
        else if x[i] is 'L'
            decrement cx
        else if x[i] is 'U'
            increment cy
        else if x[i] is 'D'
            decrement cy
        if result of run ck with tx, a - cx, ty, b- cy as arguments or ( a is cx and b is cy ) return print ( "Yes" ), 0
    end of the block
    print "No"
end of the block

[CODE]:

const int MAX = 2e6, mod = 998244353;
int dp[MAX][26];
bool ck(long long lu, long long ld, long long ru, long long rd) {
    if (lu) {
        long long step = abs(ld / lu);
        if (lu * step == ld && ru * step == rd) return 1;
    }
    if (ru) {
        long long step = abs(rd / ru);
        if (lu * step == ld && ru * step == rd) return 1;
    }
    return 0;
}
int main() {
    int a, b;
    string x;
    cin >> a >> b >> x;
    int n = x.size();
    long long tx = 0, ty = 0;
    long long cx = 0, cy = 0;
    for (int i = 0; i < n; i++) {
        if (x[i] == 'R')
            tx++;
        else if (x[i] == 'L')
            tx--;
        else if (x[i] == 'U')
            ty++;
        else if (x[i] == 'D')
            ty--;
    }
    if (ck(tx, a, ty, b) || (a == tx && b == ty)) return puts("Yes"), 0;
    for (int i = 0; i < n; i++) {
        if (x[i] == 'R')
            cx++;
        else if (x[i] == 'L')
            cx--;
        else if (x[i] == 'U')
            cy++;
        else if (x[i] == 'D')
            cy--;
        if (ck(tx, a - cx, ty, b - cy) || (a == cx && b == cy)) return puts("Yes"), 0;
    }
    puts("No");
}