#include <bits/stdc++.h>
using namespace std;
template <class T>
T Maximize(T &v, T nv) {
  if (nv > v) v = nv;
  return v;
}
template <class T>
T Minimize(T &v, T nv) {
  if (nv < v) v = nv;
  return v;
}
const long long INFLL = LONG_LONG_MAX;
const long INF = LONG_MAX, N = 101, M = 31;
long a[N], b[M];
bool c[N];
void solve() {
  long n, m;
  scanf("%ld %ld", &n, &m);
  for (long i = 1; i <= n; ++i) {
    scanf("%ld", a + i);
  }
  vector<long> q;
  for (long i = 1; i <= m; ++i) {
    long x;
    scanf("%ld", &x);
    q.push_back(a[x]);
    c[x] = 1;
  }
  sort(q.begin(), q.end(), greater<long>());
  long long res = 0;
  for (long i = 1; i <= n; ++i) {
    if (!c[i]) res += a[i];
  }
  for (long i = 0; i < m; ++i) {
    long x = q[i];
    if (res > x)
      res *= 2;
    else
      res += x;
  }
  printf("%I64d\n", res);
}
void init() { freopen("input.txt", "r", stdin); }
int main() {
  solve();
  return 0;
}
