#include <bits/stdc++.h>
using namespace std;
const int MAXN = 5e5 + 5, MAXM = 5e5 + 5, MAXK = 26, INF = 0x3f3f3f3f,
          MOD = 1e9 + 7;
int n, A, B;
int a[MAXN], b[MAXN];
int now, ans;
int ta[MAXN], tb[MAXN];
void dfs(int now, int cost) {
  if (now == n) {
    for (int i = 0; i < n; ++i) {
      ta[i] = b[i];
      tb[i] = b[n - i - 1];
    }
    bool suc = true;
    for (int i = 0; i < n; ++i) {
      if (ta[i] != tb[i]) {
        suc = false;
        break;
      }
    }
    if (!suc) return;
    ans = min(ans, cost);
    return;
  }
  if (cost > ans) return;
  if (a[now] != 2) {
    b[now] = a[now];
    dfs(now + 1, cost);
  } else {
    b[now] = 0;
    dfs(now + 1, cost + A);
    b[now] = 1;
    dfs(now + 1, cost + B);
  }
}
int main() {
  scanf("%d%d%d", &n, &A, &B);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &a[i]);
  }
  ans = 0x7fffffff;
  dfs(0, 0);
  printf("%d\n", ans == 0x7fffffff ? -1 : ans);
  return 0;
}
