#include <bits/stdc++.h>
using namespace std;
long long s = 0;
int a[101], c[31], n, m, t;
bool vis[101];
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i <= m; i++) {
    cin >> t;
    vis[t] = true;
    c[i] = a[t];
  }
  for (int i = 1; i <= n; i++) {
    if (!vis[i]) s += a[i];
  }
  sort(c + 1, c + m + 1);
  for (int i = m; i >= 1; i--) {
    if (c[i] > s)
      s += c[i];
    else
      s *= 2;
  }
  cout << s;
  return 0;
}
