#include <bits/stdc++.h>
using namespace std;
int a[300005];
int dp[300005][21];
int last[21];
int main() {
  int n, q, mx = 0, L;
  scanf("%d%d", &n, &q);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    mx = max(mx, a[i]);
  }
  L = 20;
  memset(last, -1, sizeof(last));
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j <= L; j++) {
      dp[i][j] = n + 1;
    }
  }
  for (int i = n; i >= 1; i--) {
    for (int j = 0; j <= L; j++) {
      if ((1 << j) & a[i]) {
        dp[i][j] = i;
        if (last[j] != -1) {
          for (int k = 0; k <= L; k++) {
            dp[i][k] = min(dp[i][k], dp[last[j]][k]);
          }
        }
        last[j] = i;
      }
    }
  }
  for (int i = 1; i <= q; i++) {
    int x, y;
    bool flag = false;
    scanf("%d%d", &x, &y);
    for (int j = 0; j <= L; j++) {
      if (((1 << j) & a[y]) && dp[x][j] <= y) {
        flag = true;
        break;
      }
    }
    if (flag)
      printf("Shi\n");
    else
      printf("Fou\n");
  }
  return 0;
}
