#include <bits/stdc++.h>
using namespace std;
int n, q, i, j, u, v, k;
int a[300003];
int last[19];
int go[300003][19];
int main() {
  cin >> n >> q;
  for (i = 0; i < n; i++) cin >> a[i];
  for (i = 0; i < 19; i++) {
    go[n][i] = n;
    last[i] = n;
  }
  for (i = n - 1; i >= 0; i--) {
    for (j = 0; j < 19; j++) go[i][j] = n;
    for (j = 0; j < 19; j++) {
      if ((a[i] >> j) & 1) {
        for (k = 0; k < 19; k++) go[i][k] = min(go[i][k], go[last[j]][k]);
        last[j] = i;
        go[i][j] = i;
      }
    }
  }
  for (i = 0; i < q; i++) {
    cin >> u >> v;
    u--, v--;
    bool good = false;
    for (j = 0; j < 19; j++) good |= (((a[v] >> j) & 1) && go[u][j] <= v);
    if (good)
      cout << "Shi\n";
    else
      cout << "Fou\n";
  }
}
