#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, i, j, k = 0, a[100], b[100], au[100];
  long long ans = 0;
  cin >> n >> m;
  for (i = 0; i < n; ++i) cin >> a[i];
  for (i = 0; i < m; ++i) {
    cin >> b[i];
    au[k] = a[b[i] - 1];
    a[b[i] - 1] = -1;
    k++;
  }
  k = 0;
  for (i = 0; i < n; ++i)
    if (a[i] != -1) {
      ans += a[i];
      k++;
    }
  for (i = 0; i < m - 1; ++i)
    for (j = 0; j < m - i - 1; ++j)
      if (au[j] < au[j + 1]) swap(au[j], au[j + 1]);
  for (i = 0; i < m; ++i)
    if (ans > au[i])
      ans *= 2;
    else
      ans += au[i];
  cout << ans;
  return 0;
}
