#include <bits/stdc++.h>
inline long long MAX2(long long a, long long int b) {
  return (a) > (b) ? (a) : (b);
}
inline long long MAX3(long long a, long long b, long long c) {
  return (a) > (b) ? ((a) > (c) ? (a) : (c)) : ((b) > (c) ? (b) : (c));
}
inline long long MIN2(long long a, long long b) {
  return (a) < (b) ? (a) : (b);
}
inline long long MIN3(long long a, long long b, long long c) {
  return (a) < (b) ? ((a) < (c) ? (a) : (c)) : ((b) < (c) ? (b) : (c));
}
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, A, b;
  int a[25];
  cin >> n >> A >> b;
  int i;
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  int ans = 0;
  int half = n / 2;
  int pr = MIN2(A, b);
  if (n % 2 != 0) {
    if (a[half] == 2) ans += pr;
  }
  int flag = 0;
  for (i = 0; i < half; i++) {
    if ((a[i] == 1 && a[n - i - 1] == 0) || (a[i] == 0 && a[n - i - 1] == 1)) {
      flag = 1;
      break;
    }
    if (a[i] == 1) {
      if (a[n - i - 1] == 2) ans += b;
    } else if (a[i] == 0) {
      if (a[n - i - 1] == 2) ans += A;
    } else {
      if (a[n - i - 1] == 1)
        ans += b;
      else if (a[n - i - 1] == 0)
        ans += A;
      else
        ans += 2 * pr;
    }
  }
  if (flag) {
    cout << -1;
    return 0;
  }
  cout << ans;
}
