#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  scanf("%d %d", &N, &M);
  int a[N + 3];
  for (int i = 1; i <= N; i++) scanf("%d", &a[i]);
  int b[M + 3];
  for (int i = 1; i <= M; i++) scanf("%d", &b[i]);
  int na[N + 3], ptr = 0;
  long long sum = 0;
  for (int i = 1; i <= N; i++) {
    bool found = false;
    for (int j = 1; j <= M; j++) {
      if (b[j] == i) {
        found = true;
        break;
      }
    }
    if (!found)
      sum += a[i];
    else {
      na[ptr] = a[i];
      ptr++;
    }
  }
  sort(na, na + ptr);
  reverse(na, na + ptr);
  for (int i = 0; i < ptr; i++) {
    if (sum > na[i])
      sum += sum;
    else
      sum += na[i];
  }
  printf("%I64d\n", sum);
  return 0;
}
