#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x, b;
  cin >> n >> x >> b;
  int a[n];
  int ans = 0;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  for (int i = 0; i < n / 2; ++i) {
    if ((a[i] == 2) and (a[n - i - 1] == 2)) {
      ans += 2 * min(x, b);
    } else {
      if (a[i] + a[n - i - 1] == 1) {
        cout << -1;
        return 0;
      }
      if (a[i] == a[n - i - 1]) continue;
      if (a[i] + a[n - i - 1] == 2) {
        ans += x;
      } else {
        ans += b;
      }
    }
  }
  if (n & 1) {
    if (a[n / 2] == 2) {
      ans += min(x, b);
    }
  }
  cout << ans;
  return 0;
}
