#include <bits/stdc++.h>
using namespace std;
int v[300300];
int d[20];
int dp[300300][20];
int main() {
  int n, q;
  scanf("%d", &n);
  scanf("%d", &q);
  int i, j, jt;
  for (i = 0; i < n; ++i) {
    scanf("%d", &v[i]);
  }
  fill(d, d + 20, (1 << 30));
  for (i = n - 1; i + 1; --i) {
    fill(dp[i], dp[i] + 20, (1 << 30));
    for (j = 0; j < 20; ++j) {
      if (v[i] & (1 << j)) {
        if (d[j] < n) {
          for (jt = 0; jt < 20; ++jt) {
            dp[i][jt] = min(dp[i][jt], dp[d[j]][jt]);
          }
        }
        dp[i][j] = i;
        d[j] = i;
      }
    }
  }
  for (i = 0; i < q; ++i) {
    int a, b, ok = 0;
    scanf("%d", &a);
    scanf("%d", &b);
    --a;
    --b;
    for (j = 0; j < 20; ++j) {
      if (v[b] & (1 << j)) {
        ok |= dp[a][j] <= b;
      }
    }
    printf(ok ? "Shi\n" : "Fou\n");
  }
}
