Problem: Limak is a little polar bear. His parents told him to clean a house before the New Year's Eve. Their house is a rectangular grid with h rows and w columns. Each cell is an empty square.

He is a little bear and thus he can't clean a house by himself. Instead, he is going to use a cleaning robot.

A cleaning robot has a built-in pattern of n moves, defined by a string of the length n. A single move (character) moves a robot to one of four adjacent cells. Each character is one of the following four: 'U' (up), 'D' (down), 'L' (left), 'R' (right). One move takes one minute.

A cleaning robot must be placed and started in some cell. Then it repeats its pattern of moves till it hits a wall (one of four borders of a house). After hitting a wall it can be placed and used again.

Limak isn't sure if placing a cleaning robot in one cell will be enough. Thus, he is going to start it w·h times, one time in each cell. Maybe some cells will be cleaned more than once but who cares?

Limak asks you one question. How much time will it take to clean a house? Find and print the number of minutes modulo 109 + 7. It's also possible that a cleaning robot will never stop — then print "-1" (without the quotes) instead.

Placing and starting a robot takes no time, however, you must count a move when robot hits a wall. Take a look into samples for further clarification.

Input

The first line contains three integers n, h and w (1 ≤ n, h, w ≤ 500 000) — the length of the pattern, the number of rows and the number of columns, respectively.

The second line contains a string of length n — the pattern of n moves. Each character is one of uppercase letters 'U', 'D', 'L' or 'R'.

Output

Print one line with the answer.

If a cleaning robot will never stop, print "-1" (without the quotes). Otherwise, print the number of minutes it will take to clean a house modulo 109 + 7.

Examples

Input

1 10 2
R


Output

30


Input

3 4 6
RUL


Output

134


Input

4 1 500000
RLRL


Output

-1

Note

In the first sample house is a grid with 10 rows and 2 columns. Starting a robot anywhere in the second column will result in only one move (thus, one minute of cleaning) in which robot will hit a wall — he tried to go right but there is no third column. Starting a robot anywhere in the first column will result in two moves. The total number of minutes is 10·1 + 10·2 = 30.

In the second sample a started robot will try to move "RULRULRULR..." For example, for the leftmost cell in the second row robot will make 5 moves before it stops because of hitting an upper wall.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
int add(int a, int b) { return a + b - (a + b >= MOD) * MOD; }
int mult(int a, int b) { return ((long long)a * b) % MOD; }
int n, h, w;
char s[500013];
int dX[200], dY[200];
int diffx, diffy;
int maxx, minx;
int maxy, miny;
int hasx_[1000013], hasy_[1000013];
int& hasx(int i) { return hasx_[i + 500000]; }
int& hasy(int i) { return hasy_[i + 500000]; }
void calc() {
  int x = 0, y = 0;
  for (int i = 0; i < n; i++) {
    x += dX[s[i]];
    y += dY[s[i]];
    maxx = max(maxx, x);
    minx = min(minx, x);
    maxy = max(maxy, y);
    miny = min(miny, y);
    if (!hasx(x)) hasx(x) = i + 1;
    if (!hasy(y)) hasy(y) = i + 1;
  }
  diffx = x;
  diffy = y;
}
int main() {
  dX['U'] = -1;
  dX['D'] = 1;
  dY['L'] = -1;
  dY['R'] = 1;
  scanf("%d%d%d %s", &n, &h, &w, &s);
  calc();
  if (maxx - minx + 1 <= h && maxy - miny + 1 <= w && diffx == 0 && diffy == 0)
    return printf("-1\n"), 0;
  int bot = -1, top = h;
  int lef = -1, rig = w;
  int x = 0, y = 0;
  int step = 0;
  int ans = 0;
  while (top > bot + 1 && rig > lef + 1) {
    int tryt = 1e9;
    if (x + top - 1 + maxx >= h) tryt = hasx(h - (top + x - 1));
    int tryb = 1e9;
    if (x + bot + 1 + minx <= -1) tryb = hasx(-1 - (bot + x + 1));
    int tryr = 1e9;
    if (y + rig - 1 + maxy >= w) tryr = hasy(w - (rig + y - 1));
    int tryl = 1e9;
    if (y + lef + 1 + miny <= -1) tryl = hasy(-1 - (lef + y + 1));
    if (min(min(tryt, tryb), min(tryr, tryl)) < 1e7) {
      if (tryt < min(tryb, min(tryr, tryl))) {
        int cur = mult(rig - lef - 1, mult(step, n) + tryt);
        ans = add(ans, cur);
        top -= 1;
      } else if (tryb < min(tryt, min(tryr, tryl))) {
        int cur = mult(rig - lef - 1, mult(step, n) + tryb);
        ans = add(ans, cur);
        bot += 1;
      } else if (tryr < min(tryt, min(tryb, tryl))) {
        int cur = mult(top - bot - 1, mult(step, n) + tryr);
        ans = add(ans, cur);
        rig -= 1;
      } else if (tryl < min(tryt, min(tryb, tryr))) {
        int cur = mult(top - bot - 1, mult(step, n) + tryl);
        ans = add(ans, cur);
        lef += 1;
      }
    } else {
      x += diffx;
      y += diffy;
      step += 1;
    }
  }
  printf("%d\n", ans);
  return 0;
}