#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, b;
  cin >> n >> a >> b;
  int murah = min(a, b);
  char d[30];
  for (int i = 0; i < n; i++) {
    cin >> d[i];
  }
  int cost = 0;
  bool flag = 1;
  for (int i = 0; i < n / 2; i++) {
    if (d[i] == d[n - i - 1] && d[i] != '2') {
      continue;
    } else if (d[i] == d[n - i - 1] && i == n / 2) {
      cost += murah;
    } else if (d[i] == d[n - i - 1]) {
      cost += murah * 2;
    } else if (d[i] == '0' && d[n - i - 1] == '2' ||
               d[i] == '2' && d[n - i - 1] == '0') {
      cost += a;
    } else if (d[i] == '1' && d[n - i - 1] == '2' ||
               d[i] == '2' && d[n - i - 1] == '1') {
      cost += b;
    } else {
      flag = 0;
    }
  }
  if (flag == 0) {
    cout << "-1" << endl;
  } else {
    if (n % 2 == 1 && d[n / 2] == '2') {
      cost += murah;
    }
    cout << cost << endl;
  }
  return 0;
}
