#include <bits/stdc++.h>
using namespace std;
int p[110], q[110];
long long dp[110][40];
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= n; ++i) scanf("%d", &p[i]);
  for (int i = 0; i < m; ++i) scanf("%d", &q[i]);
  long long pt = 0;
  sort(q, q + m);
  int e = 0;
  vector<long long> f, s;
  for (int i = 1; i <= n; ++i) {
    if (q[e] == i) {
      ++e;
      s.push_back(p[i]);
    } else
      f.push_back(p[i]);
  }
  sort(f.begin(), f.end());
  sort(s.begin(), s.end());
  dp[0][0] = 0;
  for (int i = 1; i <= n - m; ++i) dp[i][0] = dp[i - 1][0] + f[n - m - i];
  for (int j = 1; j <= m; ++j) {
    if (dp[0][j - 1] < s[m - j])
      dp[0][j] = dp[0][j - 1] + s[m - j];
    else
      dp[0][j] = dp[0][j - 1] << 1;
  }
  for (int i = 1; i <= n - m; ++i) {
    for (int j = 1; j <= m; ++j) {
      dp[i][j] = max(dp[i - 1][j] + f[n - m - i],
                     (dp[i][j - 1] < s[m - j] ? (dp[i][j - 1] + s[m - j])
                                              : (dp[i][j - 1] << 1)));
    }
  }
  printf("%I64d", dp[n - m][m]);
  return 0;
}
