#include <bits/stdc++.h>
using namespace std;
using LL = long long;
const int maxn = 300300;
const int maxm = 22;
int n, q;
int a[maxn], f[maxn][maxm], last[maxn];
signed main() {
  while (~scanf("%d %d", &n, &q)) {
    for (int i = 1; i <= n; i++) {
      scanf("%d", &a[i]);
    }
    for (int i = 0; i < maxm; i++) {
      f[n + 1][i] = n + 1;
      last[i] = n + 1;
    }
    for (int i = n; i >= 1; i--) {
      for (int j = 0; j < maxm; j++) {
        f[i][j] = n + 1;
      }
      for (int j = 0; j < maxm; j++) {
        if ((1 << j) & a[i]) {
          for (int k = 0; k < maxm; k++) {
            f[i][k] = min(f[i][k], f[last[j]][k]);
          }
          last[j] = i;
          f[i][j] = i;
        }
      }
    }
    while (q--) {
      int x, y;
      scanf("%d %d", &x, &y);
      int ok = 0;
      for (int j = 0; j < maxm; j++) {
        if (((1 << j) & a[y]) && f[x][j] <= y) {
          ok = 1;
          break;
        }
      }
      ok ? puts("Shi") : puts("Fou");
    }
  }
  return 0;
}
