#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
int ori[25], n, a, b, newOne[25], ans;
bool poss;
void dfs(int depth) {
  if (depth == n) {
    bool legal = 1;
    for (int i = 0, j = n - 1; i < n; i++, j--)
      if (newOne[i] != newOne[j]) {
        legal = 0;
        break;
      }
    if (legal)
      poss = 1;
    else
      return;
    int val = 0;
    for (int i = 0; i < n; i++)
      if (ori[i] != newOne[i]) {
        if (newOne[i] == 0)
          val += a;
        else
          val += b;
      }
    if (val < ans) ans = val;
    return;
  }
  if (ori[depth] == 2) {
    newOne[depth] = 0;
    dfs(depth + 1);
    newOne[depth] = 1;
    dfs(depth + 1);
    return;
  }
  newOne[depth] = ori[depth];
  dfs(depth + 1);
  return;
}
int main() {
  while (~scanf("%d%d%d", &n, &a, &b)) {
    for (int i = 0; i < n; i++) scanf("%d", &ori[i]);
    ans = 2000000000;
    poss = 0;
    dfs(0);
    if (!poss) {
      puts("-1");
      continue;
    }
    printf("%d\n", ans);
  }
}
