#include <bits/stdc++.h>
using namespace std;
long long n, m, u[300], a[300];
long long s;
vector<long long> v;
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  for (int i = 1; i <= m; ++i) {
    int t;
    cin >> t;
    u[t] = 1;
    v.push_back(a[t]);
  }
  for (int i = 1; i <= n; ++i) {
    if (u[i] == 0) s += a[i];
  }
  sort(v.begin(), v.end());
  for (int i = v.size() - 1; i >= 0; --i) {
    if (v[i] >= s) {
      s += v[i];
    } else {
      s += s;
    }
  }
  cout << s;
  return 0;
}
