#include <bits/stdc++.h>
using namespace std;
int n, q, a[300005], pr[27], pe[300005][27], lg[300005];
int main() {
  scanf("%d%d", &n, &q);
  for (int i = 2; i <= 300000; i++) lg[i] = lg[i >> 1] + 1;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    for (int j = a[i]; j; j -= (j & -j)) {
      int u = lg[j & (-j)];
      pe[i][u] = i;
      if (pr[u])
        for (int k = 0; k < 20; k++) pe[i][k] = max(pe[i][k], pe[pr[u]][k]);
      pr[u] = i;
    }
  }
  for (; q--;) {
    int x, y;
    scanf("%d%d", &x, &y);
    bool flg = 0;
    for (int j = a[x]; j; j -= j & -j) {
      int u = lg[j & -j];
      if (pe[y][u] >= x) flg = 1;
    }
    if (flg)
      puts("Shi");
    else
      puts("Fou");
  }
}
