#include <bits/stdc++.h>
using namespace std;
int n, m;
vector<int> a, b;
int num[1010];
int used[1010];
int main() {
  while (scanf("%d%d", &n, &m) != EOF) {
    a.clear();
    b.clear();
    memset(used, 0, sizeof(used));
    memset(num, 0, sizeof(num));
    for (int i = 0; i < n; ++i) {
      scanf("%d", &num[i]);
    }
    for (int i = 0; i < m; ++i) {
      int x;
      scanf("%d", &x);
      x--;
      b.push_back(num[x]);
      used[x] = 1;
    }
    for (int i = 0; i < n; ++i) {
      if (!used[i]) a.push_back(num[i]);
    }
    sort(b.begin(), b.end());
    long long sum = 0;
    int la = a.size();
    int lb = b.size();
    for (int i = 0; i < la; ++i) {
      sum += a[i];
    }
    for (int i = lb - 1; i >= 0; --i) {
      sum += max(sum, (long long)b[i]);
    }
    printf("%I64d\n", sum);
  }
}
