#include <bits/stdc++.h>
using namespace std;
long long power(long long x, long long y, long long z) {
  long long ret = 1;
  while (y > 0) {
    if (y & 1) ret = (ret * x) % z;
    x = (x * x) % z;
    y >>= 1;
  }
  return ret;
}
const long long N = 3e5 + 5, LG = 21;
long long A[N], dp[N][LG], last[LG];
int main() {
  long long n, q;
  scanf("%lld%lld", &n, &q);
  for (long long i = 1; i <= n; ++i) scanf("%lld", &A[i]);
  for (long long i = 1; i <= n + 1; ++i)
    for (long long j = 0; j <= LG - 1; ++j) dp[i][j] = n + 1, last[j] = n + 1;
  for (long long i = n; i >= 1; --i) {
    for (long long j = 0; j < LG; ++j) {
      if (A[i] & (1LL << j)) {
        for (long long k = 0; k < LG; ++k)
          dp[i][k] = min(dp[i][k], dp[last[j]][k]);
        last[j] = i;
        dp[i][j] = i;
      }
    }
  }
  while (q--) {
    long long x, y, fl = 0;
    scanf("%lld%lld", &x, &y);
    for (long long j = 0; j <= LG - 1; ++j) {
      if ((A[y] & (1LL << j)) && dp[x][j] <= y) fl = 1;
    }
    if (fl)
      printf("Shi\n");
    else
      printf("Fou\n");
  }
  return 0;
}
