#include <bits/stdc++.h>
using namespace std;
int main() {
  long long i, j, k, l = 1, m, n, mx = 0, p;
  cin >> n >> m >> k;
  int a[n + 5];
  for (i = 0; i < n; i++) cin >> a[i];
  p = (n + 1) / 2;
  for (i = 0, j = n - 1; i < p; i++, j--) {
    if (a[i] == a[j] && a[i] != 2) continue;
    if (a[i] == a[j]) {
      if (n % 2 == 1 && i == p - 1)
        mx += (1 * (min(m, k)));
      else
        mx += (2 * (min(m, k)));
    } else if (a[i] != a[j]) {
      if (a[i] == 2 || a[j] == 2) {
        if (a[j] == 0 || a[i] == 0)
          mx += m;
        else
          mx += k;
      } else
        l = 0;
    }
  }
  if (l == 0)
    cout << -1 << endl;
  else
    cout << mx << endl;
}
