#include <bits/stdc++.h>
using namespace std;
mt19937 rnd(chrono::high_resolution_clock::now().time_since_epoch().count());
const int N = 3e5 + 7;
const int LG = 19;
int go[N][LG];
int a[N];
int last[LG];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, q;
  cin >> n >> q;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int j = 0; j < LG; j++) {
    go[n][j] = n;
    last[j] = n;
  }
  for (int i = n - 1; i >= 0; i--) {
    for (int j = 0; j < LG; j++) {
      go[i][j] = n;
    }
    for (int j = 0; j < LG; j++) {
      if ((a[i] >> j) & 1) {
        for (int k = 0; k < LG; k++) {
          go[i][k] = min(go[i][k], go[last[j]][k]);
        }
        last[j] = i;
        go[i][j] = i;
      }
    }
  }
  for (int i = 0; i < q; i++) {
    int x, y;
    cin >> x >> y;
    x--, y--;
    bool good = false;
    for (int j = 0; j < LG; j++) {
      good |= (((a[y] >> j) & 1) && go[x][j] <= y);
    }
    cout << (good ? "Shi" : "Fou") << '\n';
  }
}
