#include <bits/stdc++.h>
using namespace std;
inline void scanint(int *a) {
  char c = 0;
  int sign = 1;
  while (c < 33) c = getc(stdin);
  *a = 0;
  while (c > 33) {
    if (c == '-') {
      sign = -1;
      c = getc(stdin);
      continue;
    }
    *a = *a * 10 + c - '0';
    c = getc(stdin);
  }
  *a = *a * sign;
}
char outputbuf[20];
inline void putint(int n) {
  outputbuf[19] = '\n';
  bool flag = false;
  int i = 18, r;
  if (n < 0) {
    flag = true;
    n *= -1;
  }
  while (n != 0) {
    r = n % 10;
    outputbuf[i--] = r + '0';
    n /= 10;
  }
  if (flag) outputbuf[i--] = '-';
  i++;
  while (i < 20) {
    putc(outputbuf[i++], stdout);
  }
}
int compare(const void *a, const void *b) { return (*(int *)a - *(int *)b); }
int main() {
  int n, m, inp[101], t = 0, i, x;
  long long int sm;
  scanf("%d %d", &n, &m);
  int arr[n + 1][2];
  for (i = 1; i <= n; i++) {
    scanf("%d", &arr[i][0]);
    arr[i][1] = 0;
  }
  for (i = 1; i <= m; i++) {
    scanf("%d", &x);
    arr[x][1] = 1;
    inp[t] = arr[x][0];
    t++;
  }
  qsort(inp, t, sizeof(int), compare);
  sm = 0;
  if (n > m) {
    for (i = 1; i <= n; i++) {
      if (arr[i][1] == 0) sm = sm + arr[i][0];
    }
    for (i = t - 1; i >= 0; i--) {
      if (inp[i] <= sm)
        sm = sm + sm;
      else
        sm = sm + inp[i];
    }
  } else {
    sm = inp[t - 1];
    for (i = t - 2; i >= 0; i--) {
      if (inp[i] <= sm)
        sm = sm + sm;
      else
        sm = sm + inp[i];
    }
  }
  cout << sm;
  return 0;
}
