#include using namespace std; using ll = long long; int main() { cin.tie(nullptr); ios_base::sync_with_stdio(false); int N, T; cin >> N >> T; vector t(N - 1); for (int i = 0; i < N - 1; i++) cin >> t[i]; int K; cin >> K; set x; for (int i = 0; i < K; i++) { int tmp; cin >> tmp; x.insert(tmp); } int ts = 0; for (int i = 0; i < N - 1; i++) { ts += t[i]; } int ans = max(0, (ts - T) / 10 + 1); for (int i = 0; i < N - 1; i++) { T -= t[i]; if (T <= 0) { cout << -1 << "\n"; return 0; } if (T > 0 && x.contains(i + 2)) { T += 10; } } cout << ans << "\n"; return 0; }