#include <bits/stdc++.h>
using namespace std;
const long long pp = 1e9 + 7;
const long double eps = 1e-8;
inline long long ksm(long long x, long long y = pp - 2) {
  x = (x % pp + pp) % pp;
  long long ans = 1;
  while (y) {
    if (y & 1) ans = ans * x % pp;
    x = x * x % pp;
    y >>= 1;
  }
  return ans;
}
inline long long gcd(long long x, long long y) { return y ? gcd(y, x % y) : x; }
inline void reads(char s[], int &n) {
  n = 0;
  char ch = getchar();
  while (ch == ' ' || ch == '\n' || ch == '\r') ch = getchar();
  while (ch != ' ' && ch != '\n' && ch != '\r') s[++n] = ch, ch = getchar();
}
const int l = 20;
int n, q, tmp, pt, xi, yi;
int a[300009], f[300009][29], fm[29][29], bit[300009][29], bitcnt[300009];
bool lit[300009][29];
bool answer;
int main() {
  scanf("%d%d", &n, &q);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    tmp = a[i];
    pt = 1;
    while (tmp) {
      lit[i][pt] = tmp & 1;
      tmp >>= 1, pt++;
    }
    for (int j = 1; j < pt; j++)
      if (lit[i][j]) bit[i][++bitcnt[i]] = j;
  }
  for (int i = 1; i <= l; i++)
    for (int j = 1; j <= l; j++) fm[i][j] = n + 1;
  for (int i = n; i >= 1; i--) {
    for (int j = 1; j <= bitcnt[i]; j++) f[i][bit[i][j]] = i;
    for (int j = 1; j <= l; j++)
      if (!lit[i][j]) {
        f[i][j] = n + 1;
        for (int k = 1; k <= bitcnt[i]; k++)
          f[i][j] = min(f[i][j], fm[bit[i][k]][j]);
      }
    for (int j = 1; j <= bitcnt[i]; j++)
      for (int k = 1; k <= l; k++)
        fm[bit[i][j]][k] = min(fm[bit[i][j]][k], f[i][k]);
  }
  while (q--) {
    scanf("%d%d", &xi, &yi);
    answer = 0;
    for (int i = 1; i <= bitcnt[yi]; i++)
      if (f[xi][bit[yi][i]] <= yi) {
        answer = 1;
        break;
      }
    if (answer)
      puts("Shi");
    else
      puts("Fou");
  }
  return 0;
}
