#include <bits/stdc++.h>
using namespace std;
void solve() {
  int b, x, n, ans = 0;
  cin >> n >> x >> b;
  int a[n];
  for (int i = 0; i < (n); i++) {
    cin >> a[i];
  }
  int p = 0;
  if (n % 2 == 0)
    p = n / 2;
  else
    p = (n / 2) + 1;
  for (int i = 0; i < (p); i++) {
    if (a[i] == a[n - 1 - i] && a[i] != 2)
      continue;
    else {
      if (a[i] != 2 && a[n - 1 - i] != 2) {
        cout << "-1" << endl;
        return;
      }
      if (a[i] == 2) {
        if (a[n - 1 - i] == 2) {
          if (i == ceil(n / 2))
            ans += min(x, b);
          else
            ans += 2 * min(x, b);
        } else if (a[n - i - 1] == 1)
          ans += b;
        else
          ans += x;
        continue;
      }
      if (a[n - 1 - i] == 2) {
        if (a[i] == 1)
          ans += b;
        else
          ans += x;
      }
    }
  }
  cout << ans << endl;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  solve();
}
