#include <bits/stdc++.h>
using namespace std;
const int MAXN = 300005;
const int LOG = 20;
int pre[MAXN][LOG], a[MAXN];
int n, q, ans[MAXN], lst[LOG];
int main() {
  scanf("%d%d", &n, &q);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &a[i]);
    for (int j = 0; j < LOG; ++j)
      if (a[i] & (1 << j)) {
        pre[i][j] = i;
        if (lst[j]) {
          for (int k = 0; k < LOG; ++k)
            pre[i][k] = max(pre[i][k], pre[lst[j]][k]);
        }
        lst[j] = i;
      }
  }
  int x, y;
  while (q--) {
    scanf("%d%d", &x, &y);
    bool flag = 0;
    for (int j = 0; j < LOG; ++j)
      if ((a[x] & (1 << j)) && pre[y][j] >= x) flag = 1;
    puts(flag ? "Shi" : "Fou");
  }
}
