#include <bits/stdc++.h>
using namespace std;
const int M = 105;
int s[M], a[M], b[M];
int cmp(int a, int b) { return a > b; }
int main() {
  int n, m, i, j, k;
  int x;
  while (~scanf("%d%d", &n, &m)) {
    long long ans = 0;
    for (i = 1; i <= n; i++) {
      scanf("%d", &s[i]);
      ans += s[i];
    }
    int c = 0;
    while (m--) {
      scanf("%d", &x);
      ans -= s[x];
      b[c++] = s[x];
    }
    sort(b, b + c, cmp);
    for (i = 0; i < c; i++) {
      if (ans > b[i])
        ans += ans;
      else
        ans += b[i];
    }
    cout << ans << endl;
  }
}
