#include <bits/stdc++.h>
int max(int a, int b) {
  if (a < b) return a;
  return b;
}
int main() {
  int n, k, a, b, i, sm = 0, j, blck;
  scanf("%d%d%d\n", &n, &a, &b);
  char s[1000];
  for (i = 0; i < n; i++) {
    scanf(" %c", &s[i]);
  }
  int min = max(a, b), l = n, cnt = 0;
  for (i = 0; i < n / 2; i++) {
    if (s[i] != s[l - 1 - i]) {
      if (s[i] == '2') {
        if (s[l - i - 1] == '1')
          sm += b;
        else if (s[l - 1 - i] == '0')
          sm += a;
      } else if (s[i] == '1') {
        if (s[l - 1 - i] == '0') {
          printf("-1");
          return 0;
        } else if (s[l - i - 1] == '2')
          sm += b;
      } else if (s[i] == '0') {
        if (s[l - 1 - i] == '1') {
          printf("-1");
          return 0;
        } else if (s[l - i - 1] == '2')
          sm += a;
      }
    } else if (s[i] == '2') {
      if (i == n / 2 && n % 2 == 1) {
        sm += min;
      } else {
        sm += 2 * min;
      }
    }
  }
  if (n % 2 == 1) {
    if (s[n / 2] == '2') sm += min;
  }
  printf("%d", sm);
}
