#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int N, Q;
  cin >> N >> Q;
  vector<int> A(N);
  for (int n = (0); n < (N); n++) cin >> A[n];
  vector<vector<int> > dp(N, vector<int>(20, INT_MAX)), mnoz(20);
  for (int n = N - 1; n >= 0; n--) {
    for (int i = (0); i < (20); i++) {
      if ((A[n] & (1 << i)) != 0) {
        dp[n][i] = n;
      } else {
        for (int j = (0); j < (20); j++) {
          if (mnoz[j].size() == 0 || (A[n] & (1 << j)) == 0) continue;
          dp[n][i] = min(dp[n][i], dp[mnoz[j][mnoz[j].size() - 1]][i]);
        }
      }
    }
    for (int i = (0); i < (20); i++)
      if ((A[n] & (1 << i)) != 0) mnoz[i].push_back(n);
  }
  for (int q = (0); q < (Q); q++) {
    int X, Y;
    cin >> X >> Y;
    X--;
    Y--;
    for (int i = (0); i < (20); i++) {
      if (dp[X][i] <= Y) {
        if ((A[Y] & (1 << i)) == 0) continue;
        cout << "Shi\n";
        goto vec;
      }
    }
    cout << "Fou\n";
  vec:;
  }
  return 0;
}
