#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e5 + 23;
const int lg = 20;
int dp[maxn][lg];
int n, m;
int a[maxn], last[lg];
void init() {
  memset(dp, 0, sizeof(dp));
  for (int i = 0; i < lg; i++) dp[n - 1][i] = n, last[i] = n;
}
void pre() {
  for (int i = n - 1; i >= 0; i--) {
    for (int j = 0; j < lg; j++) dp[i][j] = n;
    for (int j = 0; j < lg; j++) {
      if ((a[i] & (1 << j)) >= 1) {
        dp[i][j] = i;
        if (last[j] != n)
          for (int k = 0; k < lg; k++) dp[i][k] = min(dp[i][k], dp[last[j]][k]);
        last[j] = i;
      }
    }
  }
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < n; i++) scanf("%d", a + i);
  init();
  pre();
  for (int i = 0; i < m; i++) {
    bool can = false;
    int a1, a2;
    scanf("%d %d", &a1, &a2);
    a1--, a2--;
    for (int i = 0; i < lg; i++) {
      if ((a[a2] & (1 << i)) >= 1) {
        if (dp[a1][i] <= a2) {
          can = true;
          break;
        }
      }
    }
    if (can)
      printf("Shi\n");
    else
      printf("Fou\n");
  }
}
