#include <bits/stdc++.h>
int compare(const void *a, const void *b) {
  long long *orderA = (long long *)a;
  long long *orderB = (long long *)b;
  long long int k;
  k = *orderA - *orderB;
  if (k > 0)
    return (1);
  else if (k < 0)
    return (-1);
  else
    return (0);
}
int main() {
  long long int n, m, a[101], t = 0, pt, i, x, ach[101][2];
  scanf("%lld %lld", &n, &m);
  for (i = 1; i <= n; i++) {
    scanf("%lld", &ach[i][0]);
    ach[i][1] = 0;
  }
  for (i = 1; i <= m; i++) {
    scanf("%lld", &x);
    ach[x][1] = 1;
    a[t] = ach[x][0];
    t++;
  }
  qsort(a, t, sizeof(long long int), compare);
  pt = 0;
  if (n > m) {
    for (i = 1; i <= n; i++) {
      if (ach[i][1] == 0) pt = pt + ach[i][0];
    }
    for (i = t - 1; i >= 0; i--) {
      if (a[i] <= pt)
        pt = pt + pt;
      else
        pt = pt + a[i];
    }
  } else {
    pt = a[t - 1];
    for (i = t - 2; i >= 0; i--) {
      if (a[i] <= pt)
        pt = pt + pt;
      else
        pt = pt + a[i];
    }
  }
  printf("%lld", pt);
  return 0;
}
