#include <bits/stdc++.h>
using namespace std;
int A[300005];
int nxt[300005][20];
int recent[20];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int a, b, c, d, n, m, t;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> A[i];
  }
  for (long long(i) = 0; (i) < (n); ++(i)) {
    for (long long(j) = 0; (j) < (19); ++(j)) {
      nxt[i][j] = n;
    }
    recent[i] = n;
  }
  for (int i = n - 1; i >= 0; i--) {
    for (long long(bit) = 0; (bit) < (19); ++(bit)) {
      if (A[i] & (1 << bit)) {
        int where = recent[bit];
        nxt[i][bit] = min(nxt[i][bit], where);
        if (where != n) {
          for (long long(k) = 0; (k) < (19); ++(k)) {
            nxt[i][k] = min(nxt[i][k], nxt[where][k]);
          }
        }
        recent[bit] = i;
      }
    }
  }
  while (m--) {
    cin >> a >> b;
    a--;
    b--;
    bool flag = 0;
    for (long long(i) = 0; (i) < (19); ++(i)) {
      if (A[b] & (1 << i)) {
        if (nxt[a][i] <= b) {
          flag = 1;
          break;
        }
      }
    }
    if (flag) {
      cout << "Shi" << endl;
    } else {
      cout << "Fou" << endl;
    }
  }
  return 0;
}
