#include <bits/stdc++.h>
using namespace std;
ifstream f("cf.in");
int k, n, m, x, y, mx, mn, b, a;
unsigned long long sum;
string s;
vector<int> questions, sorted;
bitset<10000004> auction_q;
int main() {
  cin >> n >> m;
  questions.resize(n + 1);
  for (int i = 1; i <= n; ++i) cin >> questions[i];
  for (int i = 1; i <= m; ++i) cin >> x, auction_q[x] = 1;
  for (int i = 1; i <= n; ++i)
    if (!auction_q[i])
      sum += questions[i];
    else
      sorted.push_back(questions[i]);
  sort(sorted.begin(), sorted.end());
  reverse(sorted.begin(), sorted.end());
  for (int i = 0; i < sorted.size(); ++i)
    sum += max(sum, (unsigned long long)sorted[i]);
  cout << sum;
  return 0;
}
