#include <bits/stdc++.h>
using namespace std;
int main() {
  long long ans;
  int x;
  int a[105], b1[104], b2[105], c[105];
  int n, m;
  while (cin >> n >> m) {
    ans = 0;
    for (int i = 1; i <= n; i++) cin >> a[i];
    memset(c, 0, sizeof(c));
    for (int i = 0; i < m; i++) {
      cin >> x;
      c[x] = 1;
    }
    int b = 0, bb = 0;
    for (int i = 1; i <= n; i++) {
      if (c[i] == 1) {
        b1[b++] = a[i];
      } else {
        b2[bb++] = a[i];
      }
    }
    for (int i = 0; i < bb; i++) ans += b2[i];
    sort(b1, b1 + b);
    for (int i = b - 1; i >= 0; i--)
      if (ans >= b1[i])
        ans += ans;
      else
        ans += b1[i];
    cout << ans << endl;
  }
  return 0;
}
