#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 1;
int n, a, b, f[maxn];
void Enter() {
  cin >> n >> a >> b;
  for (int i = 1; i <= n; ++i) cin >> f[i];
}
void Init() {}
void Solve() {
  int res = 0;
  int i, j;
  for (i = 1, j = n; i < j; ++i, --j)
    if (min(f[i], f[j]) == 0 && max(f[i], f[j]) == 1) {
      cout << -1;
      return;
    } else if (max(f[i], f[j]) == 2)
      if (f[i] == f[j])
        res += min(a, b) * 2;
      else if (min(f[i], f[j]) == 0)
        res += a;
      else
        res += b;
    else
      res += 0;
  if (i == j && f[i] == 2) res += min(a, b);
  cout << res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  Enter();
  Init();
  Solve();
}
