#include <bits/stdc++.h>
using namespace std;
void print(long long int a[], long long int n) {
  for (long long int i = 0; i < n; i++) {
    cout << a[i] << " ";
  }
  cout << "\n";
}
long long int power(long long int x) {
  long long int u = 0;
  while (x % 2 == 0) {
    u++;
    x = x / 2;
  }
  return u;
}
long long int powM(long long int x, long long int y, long long int m) {
  long long int ans = 1, r = 1;
  x %= m;
  while (r > 0 && r <= y) {
    if (r & y) {
      ans *= x;
      ans %= m;
    }
    r <<= 1;
    x *= x;
    x %= m;
  }
  return ans;
}
int powm(long long int a, long long int b) {
  long long int res = 1;
  while (b) {
    if (b & 1) res = (res * a);
    a = (a * a);
    b >>= 1;
  }
  return res;
}
long long int gcd(long long int a, long long int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
bool isPrime(int n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (int i = 5; i * i <= n; i = i + 6)
    if (n % i == 0 || n % (i + 2) == 0) return false;
  return true;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t1 = 1;
  long long int M = 1e9 + 7;
  while (t1--) {
    long long int n, m;
    cin >> n >> m;
    long long int x, k, y;
    cin >> x >> k >> y;
    n = n + 2;
    m = m + 2;
    long long int a[n];
    long long int b[m];
    a[0] = 0;
    a[n - 1] = -1;
    b[0] = 0;
    b[m - 1] = -1;
    for (long long int i = 1; i < n - 1; i++) {
      cin >> a[i];
    }
    for (long long int i = 1; i < m - 1; i++) {
      cin >> b[i];
    }
    map<long long int, long long int> m1;
    for (long long int i = 0; i < n; i++) {
      m1[a[i]] = i;
    }
    if (m > n) {
      cout << "-1";
    } else {
      long long int l = 1;
      long long int o = m1[b[0]];
      for (long long int i = 0; i < m; i++) {
        if (m1.find(b[i]) == m1.end()) {
          l = 0;
          break;
        }
        if (m1[b[i]] < o) {
          l = 0;
          break;
        }
        o = max(o, m1[b[i]]);
      }
      if (l == 0) {
        cout << "-1";
      } else {
        long long int u = 0;
        for (long long int i = 0; i < m - 1; i++) {
          long long int q = m1[b[i + 1]] - m1[b[i]] - 1;
          if (q == 0) {
            continue;
          }
          long long int p = a[m1[b[i]] + 1];
          for (long long int j = m1[b[i]] + 1; j < m1[b[i + 1]]; j++) {
            p = max(p, a[j]);
          }
          if ((m1[b[i + 1]] - m1[b[i]] - 1) % k != 0) {
            if (q < k) {
              if (b[i] < p && b[i + 1] < p) {
                l = 0;
                break;
              }
            }
            u += (q % k) * y;
            if (k * y >= x) {
              u += (q / k) * x;
            } else {
              if (a[m1[b[i]]] > p || a[m1[b[i + 1]]] > p) {
                u += (q - q % k) * y;
              } else {
                u += x;
                u += (q - (q % k) - k) * y;
              }
            }
          } else {
            if (k * y >= x) {
              u += (q / k) * x;
            } else {
              if (a[m1[b[i]]] > p || a[m1[b[i + 1]]] > p) {
                u += (q)*y;
              } else {
                u += x;
                u += (q - k) * y;
              }
            }
          }
        }
        if (l) {
          cout << u;
        } else {
          cout << -1;
        }
      }
    }
  }
  return 0;
}

### Prompt

Construct a Cpp code solution to the problem outlined:

There are n warriors in a row. The power of the i-th warrior is a_i. All powers are pairwise distinct.

You have two types of spells which you may cast: 

  1. Fireball: you spend x mana and destroy exactly k consecutive warriors; 
  2. Berserk: you spend y mana, choose two consecutive warriors, and the warrior with greater power destroys the warrior with smaller power. 



For example, let the powers of warriors be [2, 3, 7, 8, 11, 5, 4], and k = 3. If you cast Berserk on warriors with powers 8 and 11, the resulting sequence of powers becomes [2, 3, 7, 11, 5, 4]. Then, for example, if you cast Fireball on consecutive warriors with powers [7, 11, 5], the resulting sequence of powers becomes [2, 3, 4].

You want to turn the current sequence of warriors powers a_1, a_2, ..., a_n into b_1, b_2, ..., b_m. Calculate the minimum amount of mana you need to spend on it.

Input

The first line contains two integers n and m (1 ≤ n, m ≤ 2 ⋅ 10^5) — the length of sequence a and the length of sequence b respectively.

The second line contains three integers x, k, y (1 ≤ x, y, ≤ 10^9; 1 ≤ k ≤ n) — the cost of fireball, the range of fireball and the cost of berserk respectively.

The third line contains n integers a_1, a_2, ..., a_n (1 ≤ a_i ≤ n). It is guaranteed that all integers a_i are pairwise distinct.

The fourth line contains m integers b_1, b_2, ..., b_m (1 ≤ b_i ≤ n). It is guaranteed that all integers b_i are pairwise distinct.

Output

Print the minimum amount of mana for turning the sequnce a_1, a_2, ..., a_n into b_1, b_2, ..., b_m, or -1 if it is impossible.

Examples

Input


5 2
5 2 3
3 1 4 5 2
3 5


Output


8


Input


4 4
5 1 4
4 3 1 2
2 4 3 1


Output


-1


Input


4 4
2 1 11
1 3 2 4
1 3 2 4


Output


0

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
void print(long long int a[], long long int n) {
  for (long long int i = 0; i < n; i++) {
    cout << a[i] << " ";
  }
  cout << "\n";
}
long long int power(long long int x) {
  long long int u = 0;
  while (x % 2 == 0) {
    u++;
    x = x / 2;
  }
  return u;
}
long long int powM(long long int x, long long int y, long long int m) {
  long long int ans = 1, r = 1;
  x %= m;
  while (r > 0 && r <= y) {
    if (r & y) {
      ans *= x;
      ans %= m;
    }
    r <<= 1;
    x *= x;
    x %= m;
  }
  return ans;
}
int powm(long long int a, long long int b) {
  long long int res = 1;
  while (b) {
    if (b & 1) res = (res * a);
    a = (a * a);
    b >>= 1;
  }
  return res;
}
long long int gcd(long long int a, long long int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
bool isPrime(int n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (int i = 5; i * i <= n; i = i + 6)
    if (n % i == 0 || n % (i + 2) == 0) return false;
  return true;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t1 = 1;
  long long int M = 1e9 + 7;
  while (t1--) {
    long long int n, m;
    cin >> n >> m;
    long long int x, k, y;
    cin >> x >> k >> y;
    n = n + 2;
    m = m + 2;
    long long int a[n];
    long long int b[m];
    a[0] = 0;
    a[n - 1] = -1;
    b[0] = 0;
    b[m - 1] = -1;
    for (long long int i = 1; i < n - 1; i++) {
      cin >> a[i];
    }
    for (long long int i = 1; i < m - 1; i++) {
      cin >> b[i];
    }
    map<long long int, long long int> m1;
    for (long long int i = 0; i < n; i++) {
      m1[a[i]] = i;
    }
    if (m > n) {
      cout << "-1";
    } else {
      long long int l = 1;
      long long int o = m1[b[0]];
      for (long long int i = 0; i < m; i++) {
        if (m1.find(b[i]) == m1.end()) {
          l = 0;
          break;
        }
        if (m1[b[i]] < o) {
          l = 0;
          break;
        }
        o = max(o, m1[b[i]]);
      }
      if (l == 0) {
        cout << "-1";
      } else {
        long long int u = 0;
        for (long long int i = 0; i < m - 1; i++) {
          long long int q = m1[b[i + 1]] - m1[b[i]] - 1;
          if (q == 0) {
            continue;
          }
          long long int p = a[m1[b[i]] + 1];
          for (long long int j = m1[b[i]] + 1; j < m1[b[i + 1]]; j++) {
            p = max(p, a[j]);
          }
          if ((m1[b[i + 1]] - m1[b[i]] - 1) % k != 0) {
            if (q < k) {
              if (b[i] < p && b[i + 1] < p) {
                l = 0;
                break;
              }
            }
            u += (q % k) * y;
            if (k * y >= x) {
              u += (q / k) * x;
            } else {
              if (a[m1[b[i]]] > p || a[m1[b[i + 1]]] > p) {
                u += (q - q % k) * y;
              } else {
                u += x;
                u += (q - (q % k) - k) * y;
              }
            }
          } else {
            if (k * y >= x) {
              u += (q / k) * x;
            } else {
              if (a[m1[b[i]]] > p || a[m1[b[i + 1]]] > p) {
                u += (q)*y;
              } else {
                u += x;
                u += (q - k) * y;
              }
            }
          }
        }
        if (l) {
          cout << u;
        } else {
          cout << -1;
        }
      }
    }
  }
  return 0;
}

```