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