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;
long long gcd(long long a, long long b) {
  long long r;
  while (b != 0) {
    r = a % b;
    a = b;
    b = r;
  }
  return a;
}
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
long long fpow(long long n, long long k, int p = (int)1e9 + 7) {
  long long r = 1;
  for (; k; k >>= 1) {
    if (k & 1) r = r * n % p;
    n = n * n % p;
  }
  return r;
}
const int MOD = (int)1e9 + 7;
const int INF = (int)1e9;
const long long LINF = (long long)1e18;
const long double PI = 2 * acos((long double)0);
const int maxn = 500010;
int n, w, h;
char s[maxn];
int xmin[maxn];
int xmax[maxn];
int ymin[maxn];
int ymax[maxn];
long long alox[maxn];
long long aloy[maxn];
long long tot[maxn];
void solve() {
  scanf("%d%d%d%s", &n, &h, &w, s);
  int dx = 0, dy = 0;
  for (int i = (0); i < (n); i++) {
    if (s[i] == 'L')
      dx--;
    else if (s[i] == 'R')
      dx++;
    else if (s[i] == 'U')
      dy--;
    else
      dy++;
    if (!i) {
      xmin[i] = xmax[i] = dx;
      ymin[i] = ymax[i] = dy;
    } else {
      xmin[i] = min(xmin[i - 1], dx);
      xmax[i] = max(xmax[i - 1], dx);
      ymin[i] = min(ymin[i - 1], dy);
      ymax[i] = max(ymax[i - 1], dy);
    }
  }
  for (int i = (0); i < (w); i++) {
    int c = 0;
    if (i + xmin[n - 1] >= 0 && i + xmax[n - 1] < w) {
      int l = 0, r = INF;
      while (l < r) {
        int m = (l + r) >> 1;
        if (dx >= 0) {
          if (i + xmax[n - 1] + 1LL * m * dx < w)
            l = m + 1;
          else
            r = m;
        } else {
          if (i + xmin[n - 1] + 1LL * m * dx >= 0)
            l = m + 1;
          else
            r = m;
        }
      }
      c = l;
    }
    if (c == INF) {
      alox[i] = -1;
      continue;
    }
    int l = 0, r = n - 1;
    while (l < r) {
      int m = (l + r) >> 1;
      if (i + xmin[m] + 1LL * c * dx >= 0 && i + xmax[m] + 1LL * c * dx < w)
        l = m + 1;
      else
        r = m;
    }
    alox[i] = 1LL * c * n + l + 1;
  }
  for (int i = (0); i < (h); i++) {
    int c = 0;
    if (i + ymin[n - 1] >= 0 && i + ymax[n - 1] < h) {
      int l = 0, r = INF;
      while (l < r) {
        int m = (l + r) >> 1;
        if (dy >= 0) {
          if (i + ymax[n - 1] + 1LL * m * dy < h)
            l = m + 1;
          else
            r = m;
        } else {
          if (i + ymin[n - 1] + 1LL * m * dy >= 0)
            l = m + 1;
          else
            r = m;
        }
      }
      c = l;
    }
    if (c == INF) {
      aloy[i] = -1;
      continue;
    }
    int l = 0, r = n - 1;
    while (l < r) {
      int m = (l + r) >> 1;
      if (i + ymin[m] + 1LL * c * dy >= 0 && i + ymax[m] + 1LL * c * dy < h)
        l = m + 1;
      else
        r = m;
    }
    aloy[i] = 1LL * c * n + l + 1;
  }
  int flagx = 0, flagy = 0;
  for (int i = (0); i < (w); i++) {
    if (!~alox[i]) {
      flagx = 1;
      alox[i] = LINF;
    }
  }
  for (int i = (0); i < (h); i++) {
    if (!~aloy[i]) {
      flagy = 1;
      aloy[i] = LINF;
    }
  }
  if (flagx && flagy) {
    printf("-1");
    return;
  }
  int ans = 0;
  sort(aloy, aloy + h);
  for (int i = (0); i < (h); i++) {
    if (!i)
      tot[i] = aloy[i] % MOD;
    else
      tot[i] = (tot[i - 1] + aloy[i]) % MOD;
  }
  for (int i = (0); i < (w); i++) {
    int k = upper_bound(aloy, aloy + h, alox[i]) - aloy - 1;
    if (~k) ans = (ans + tot[k]) % MOD;
    ans = (ans + 1LL * (h - k - 1) * alox[i]) % MOD;
  }
  printf("%d", ans);
}
int main() {
  solve();
  return 0;
}