#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, b;
  cin >> n >> a >> b;
  int count = 0;
  int c[30];
  for (int i = 0; i < n; i++) {
    cin >> c[i];
  }
  if (a > b) {
    for (int i = 0; i < n / 2; i++) {
      if (c[i] == c[n - 1 - i] && c[i] != 2) {
        continue;
      } else if (c[i] == c[n - 1 - i] && c[i] == 2) {
        count = count + b * 2;
      } else if ((c[i] != c[n - 1 - i] && c[n - 1 - i] == 2) ||
                 (c[i] != c[n - 1 - i] && c[i] == 2)) {
        if (c[i] == 1 || c[n - 1 - i] == 1) {
          count = count + b;
        } else {
          count = count + a;
        }
      } else if (c[i] != c[n - 1 - i] && c[n - 1 - i] != 2) {
        cout << "-1";
        return 0;
      }
    }
    if (n % 2 == 0) {
      cout << count;
    } else {
      int x = (n / 2);
      if (c[x] == 2) {
        count = count + b;
      }
      cout << count;
    }
  } else {
    for (int i = 0; i < n / 2; i++) {
      if (c[i] == c[n - 1 - i] && c[i] != 2) {
        continue;
      } else if (c[i] == c[n - 1 - i] && c[i] == 2) {
        count = count + a * 2;
      } else if ((c[i] != c[n - 1 - i] && c[n - 1 - i] == 2) ||
                 (c[i] != c[n - 1 - i] && c[i] == 2)) {
        if (c[i] == 1 || c[n - 1 - i] == 1) {
          count = count + b;
        } else {
          count = count + a;
        }
      } else if (c[i] != c[n - 1 - i] && c[n - 1 - i] != 2) {
        cout << "-1";
        return 0;
      }
    }
    if (n % 2 == 0) {
      cout << count;
    } else {
      int x = (n / 2);
      if (c[x] == 2) {
        count = count + a;
      }
      cout << count;
    }
  }
}
