#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 1e6 + 10;
const long long INF = 1e9 + 10;
const int MOD = 998244353;
int n, q, a[MAXN];
int dp[MAXN][20];
vector<int> pos[20];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> q;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    for (int j = 0; j < 20; j++) {
      if ((a[i] >> j) & 1) pos[j].push_back(i);
    }
  }
  for (int i = n - 1; i >= 0; i--) {
    for (int j = 0; j < 20; j++) {
      if ((a[i] >> j) & 1)
        dp[i][j] = i;
      else
        dp[i][j] = n;
    }
    for (int j = 0; j < 20; j++) {
      if ((a[i] >> j) & 1) {
        auto nxtpos = upper_bound(pos[j].begin(), pos[j].end(), i);
        if (nxtpos == pos[j].end()) continue;
        int nxt = *nxtpos;
        for (int j1 = 0; j1 < 20; j1++) dp[i][j1] = min(dp[i][j1], dp[nxt][j1]);
      }
    }
  }
  while (q--) {
    int from, to;
    cin >> from >> to;
    from--;
    to--;
    bool good = 0;
    for (int j = 0; j < 20; j++) {
      good |= (dp[from][j] <= to && (a[to] >> j) & 1);
    }
    good ? cout << "Shi\n" : cout << "Fou\n";
  }
  return 0;
}
