#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int sum = 0, ff = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') ff = -1;
    ch = getchar();
  }
  while (isdigit(ch)) sum = sum * 10 + (ch ^ 48), ch = getchar();
  return sum * ff;
}
const int N = 3e5 + 5;
const int M = 21;
int n, m, f[N][M], a[N], las[M];
int main() {
  n = read();
  m = read();
  for (int i = 1; i <= n; i++) a[i] = read();
  for (int i = n; i >= 1; i--) {
    for (int j = 0; j <= 20; j++) f[i][j] = n + 1;
    for (int j = 0; j <= 20; j++)
      if ((a[i] >> j) & 1) {
        if (las[j])
          for (int k = 0; k <= 20; k++) f[i][k] = min(f[i][k], f[las[j]][k]);
        las[j] = i;
        f[i][j] = i;
      }
  }
  for (; m--;) {
    int x, y;
    x = read(), y = read();
    int flg = 1;
    for (int i = 0; i <= 20; i++) {
      if (((a[y] >> i) & 1) && f[x][i] <= y) flg = 0;
      if (!flg) break;
    }
    if (!flg)
      puts("Shi");
    else
      puts("Fou");
  }
  return 0;
}
