#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 7;
const int INF = 1e9 + 7;
int dp[N][27], closest[N][27], last[27];
int a[N];
int n, q;
int top_down(int index, int bit) {
  if (a[index] & (1 << bit)) return index;
  if (dp[index][bit]) return dp[index][bit];
  dp[index][bit] = INF;
  for (int j = 0; j <= 20; j++) {
    if (a[index] & (1 << j)) {
      if (closest[index][j] != -1 && closest[index][j] != index) {
        dp[index][bit] = min(dp[index][bit], top_down(closest[index][j], bit));
      }
    }
  }
  return dp[index][bit];
}
int main() {
  cin >> n >> q;
  fill(last, last + 22, 1);
  memset(closest, -1, sizeof(closest));
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j <= 20; j++) {
      if (a[i] & (1 << j)) {
        for (int c = last[j]; c < i; c++) closest[c][j] = i;
        last[j] = i;
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j <= 20; j++) {
      if (!dp[i][j]) {
        dp[i][j] = top_down(i, j);
      }
    }
  }
  for (int i = 1; i <= q; i++) {
    int l, r;
    bool ans = false;
    scanf("%d%d", &l, &r);
    for (int j = 0; j <= 20; j++)
      if (a[r] & (1 << j) && dp[l][j] <= r) ans = true;
    if (ans)
      puts("Shi");
    else
      puts("Fou");
  }
}
