#include <bits/stdc++.h>
using namespace std;
const int N = 2001000;
int n, m, P[N];
int NIZ[N];
inline void load() {
  scanf("%d %d", &n, &m);
  for (int i = 0; i < m; i++) scanf("%d", &P[i]);
}
inline int find_first(int x) { return upper_bound(P, P + m, x) - P - 1; }
set<int> S;
struct fenwick {
  int tree[1001000];
  int n;
  fenwick() {
    memset(tree, 0, sizeof(tree));
    n = 1000001;
  }
  inline void add(int x, int val) {
    for (; x < n; x += x & -x) tree[x] += val;
  }
  inline int get(int x) {
    int ans = 0;
    for (; x; x -= x & -x) ans += tree[x];
    return ans;
  }
  inline int bs(int x) {
    int low = 1, high = 1000000, middle;
    while (low <= high) {
      middle = (low + high) >> 1;
      if (get(middle) >= x)
        high = middle - 1;
      else
        low = middle + 1;
    }
    return low;
  }
} F;
int POS[N];
inline void solve() {
  int curr = 0;
  int pos = 1;
  int last = 1;
  for (int i = 0; i < n; i++) {
    int x;
    scanf("%d", &x);
    if (x == 1 || x == 0) {
      F.add(pos, 1);
      NIZ[pos] = x;
      curr++;
      pos++;
    } else {
      int k = find_first(curr);
      if (k != -1 && P[k] <= curr) {
        for (int j = 0; j <= k; j++) {
          int posi = F.bs(P[j]);
          POS[j] = posi;
        }
        for (int j = 0; j <= k; j++) F.add(POS[j], -1);
        curr -= k + 1;
      }
    }
  }
  if (curr == 0) {
    printf("Poor stack!\n");
  } else {
    for (int i = 1; i <= curr; i++) {
      int idx = F.bs(i);
      printf("%d", NIZ[idx]);
    }
    printf("\n");
  }
}
int main(void) {
  load();
  solve();
  return 0;
}
