#include <bits/stdc++.h>
using namespace std;
long long ans = 0, mi, cim;
long long n, w, b;
void chepal(char a[]) {
  long long t = n;
  long long l = -1;
  while (t - l > 2) {
    l++;
    t--;
    if (a[l] == '2' && a[t] == '2') {
      a[l] = a[t] = mi;
      ans = ans + min(w, b) + min(w, b);
      continue;
    }
    if (a[l] == '2' || a[t] == '2') {
      if (a[l] == '2') {
        if (a[t] == '1') {
          a[l] = a[t];
          ans += b;
        }
        if (a[t] == '0') {
          a[l] = a[t];
          ans += w;
        }
      }
      if (a[t] == '2') {
        if (a[l] == '1') {
          a[t] = a[l];
          ans += b;
        }
        if (a[l] == '0') {
          a[t] = a[l];
          ans += w;
        }
      }
      continue;
    }
    if (a[l] != a[t]) {
      ans = -1;
      return;
    }
  }
  l++;
  t--;
  if (l == t) {
    if (a[l] == '2') {
      ans += min(w, b);
    }
  }
}
int main() {
  cin >> n >> w >> b;
  long long t = n;
  char a[n];
  long long i = 0;
  if (w < b)
    mi = '0';
  else
    mi = '1';
  while (t--) {
    cin >> a[i];
    i++;
  }
  chepal(a);
  cout << ans;
}
